Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-setting named range

Status
Not open for further replies.

kray4660

MIS
Apr 7, 2008
1,054
0
0
US
I have an existing named range called TotalActions. But I want to use VBA code to change that range. But the code I have basically does nothing (i.e., the value for the named range TotalActions does not get modified). Everything I have found so far indicates that my code is correct.

With ActiveWorkbook.Names("TotalActions")
.RefersTo = "=AV1!$G5:$G8"
End With

Any suggestions will be appreciated.
 
Found out some further information. It appears my code sorta works. I tried a different range and it did change the range, but it is offsetting the rows by four rows. i.e., I set the range to A1:A5 and it shows the range as A5:A9. I have no idea why.
 
Not sure, but it appears it was doing an offset from a active cell. When I set the active cell to A1, it appears to be working correctly now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top