Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi guys, I've looked around at CPearson, OZGrid and Debra's (the name of
which escapes me atm) but I haven't so far found a solution to my problem. I'm pulling in data from another workbook and then defining named ranges based on the updated data. This is all working fine as are the lines that work out the name of the range and the address of the range. Here's the code I'm using... dynRangeName = Cells(thisRow, thisCol).Value & depts(thisCol) & "Testers" Set dynamicRange = Range(Cells(startRow, thisCol + 1), Cells(thisRow, thisCol + 1)) Debug.Print dynRangeName & " = " & dynamicRange.Address ThisWorkbook.Names.Add dynRangeName, dynamicRange The Debug.Print line outputs lines such as these (which are the correct names and the correct ranges): ESFncTesters = $B$2:$B$61 LSFncTesters = $B$62:$B$123 NSFncTesters = $B$124:$B$174 My only problem now is that these named ranges that I've added using "ThisWorkbook.Names.Add" aren't displaying in the Names list (through Insert Names Define...) and as I'm using these NRs for Data Validation, the DV doesn't work :-( Any ideas? I've tried using "Visible:True" on the creation of the names with no luck. If I create all these names with "rubbish" ranges through the menu system in Excel when VBA overwrites these names it works, but I didn't really want to go down this route if I can help it...I don't want to have to rely on me (or other users) inserting names so the VBA can add them correctly... Thanks as usual - this forum's been a superb resource for me. Top work you guys! George |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Names is Defined by Cell value on Sheet 1 (named Summary | Excel Discussion (Misc queries) | |||
Reviewing a list of defined named ranges | Excel Programming | |||
List of defined names | Excel Worksheet Functions | |||
Using a data validation list to look up a defined named range in another worksheet | Charts and Charting in Excel | |||
Defined named range to array | Excel Programming |