Answers for "vba change named range address"

VBA
0

vba change named range address

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
Posted by: Guest on May-06-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language