Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro defining dynamic named ranges
At times I need to change the source data used in some formulas.
When this happens I would like to remove the source data sheet, called RawData, and import a new sheet that contains current data. I am trying to write a macro that would define named dynamic ranges on RawData. Im using this code I copied from some other post: ThisWorkbook.Names.Add Name:="dAge", RefersTo:="=OFFSET(RawData!$H$1,0,0,COUNTA(RawData !$H:$H),1)", Visible:=True This line doesnt leave any trace in the Name list; InsertNamePastePaste List does not show €śdAge€ť, nor does a loop with €śDebug.Print crtName.Name, crtName.RefersTo, crtName.Visible€ť Even worse, this simpler one doesnt work either ThisWorkbook.Names.Add Name:="dAge7", RefersTo:="=RawData!$H$1:$H$10", Visible:=True When I add the name with InsertNameDefine this works: =OFFSET(RawData!$H$1,0,0,COUNTA(RawData!$H:$H),1) I would appreciate any help with this syntax or other suggestions for updating/defining dynamic ranges in VB. Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic Named Ranges - is this possible? | Excel Worksheet Functions | |||
Defining an R1C1 style dynamic named range using vba | Excel Programming | |||
Defining a named range for a dynamic result set | Excel Programming | |||
Dynamic Named Ranges | Excel Discussion (Misc queries) | |||
Defining Dynamic Ranges in Macro | Excel Programming |