Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a sheet with a named range. every month i add a row of data via a
macro. How can I set the named range to also get one row larger? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
have a look he
http://www.contextures.com/xlNames01.html#Dynamic -- jb "thomas donino" wrote: I have a sheet with a named range. every month i add a row of data via a macro. How can I set the named range to also get one row larger? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should do what you want (just change the two occurences of "MyRange" to
the actual name of your range)... With Range("MyRange") ActiveWorkbook.Names("MyRange").RefersTo = Replace(.Name, .Address, _ .Resize(.Rows.Count + 1).Address) End With -- Rick (MVP - Excel) "thomas donino" wrote in message ... I have a sheet with a named range. every month i add a row of data via a macro. How can I set the named range to also get one row larger? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or
with range("MyRange") .resize(.rows.count+1).name = .Name.Name end with or with range("MyRange") .resize(.rows.count+1).name = "MyRange" end with If the name is local to the sheet (not a global name): with worksheets("somesheetnamehere").range("MyRange") .resize(.rows.count+1).name = "'" & .parent.name & "'!" & .Name.Name end with or with worksheets("somesheetnamehere").range("MyRange") .resize(.rows.count+1).name = "'" & .parent.name & "'!MyRange" end with Rick Rothstein wrote: This should do what you want (just change the two occurences of "MyRange" to the actual name of your range)... With Range("MyRange") ActiveWorkbook.Names("MyRange").RefersTo = Replace(.Name, .Address, _ .Resize(.Rows.Count + 1).Address) End With -- Rick (MVP - Excel) "thomas donino" wrote in message ... I have a sheet with a named range. every month i add a row of data via a macro. How can I set the named range to also get one row larger? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named ranges and pasting formulas with named references | Excel Programming | |||
INDEX formula returns #REF! error for ranges larger than two cells | Excel Worksheet Functions | |||
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... | Excel Programming | |||
Copy data in named ranges to a newer version of the same template to identical ranges | Excel Programming | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) |