📜  vba 更改命名范围地址 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:56.847000             🧑  作者: Mango

代码示例1
Dim wb As Workbook
Dim nr As Name

Set wb = ActiveWorkbook
Set nr = wb.Names.Item("myRange")

' give an absolute reference:
nr.RefersTo = "=Sheet1!$C$1:$C$9"

' or, resize relative to old reference:
With nr
    .RefersTo = .RefersToRange.Resize(100, 1)
End With