LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 347
Default VBA defined named range not appearing in Names list...

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet Names is Defined by Cell value on Sheet 1 (named Summary NeedToKnow Excel Discussion (Misc queries) 7 January 7th 09 07:44 PM
Reviewing a list of defined named ranges Barb Reinhardt Excel Programming 3 August 21st 06 06:00 PM
List of defined names coa01gsb Excel Worksheet Functions 4 March 21st 06 04:53 PM
Using a data validation list to look up a defined named range in another worksheet Laura Hunt Charts and Charting in Excel 0 November 24th 05 02:29 PM
Defined named range to array MattShoreson[_2_] Excel Programming 1 December 4th 03 10:06 AM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"