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: 1
Default adding a VBA name to workbook names collection


Hi,

The variable rng_MGXdataSemiAnnual exists in the dropdown box in the
worksheet and refers to a matrix in the worksheet. There is a similar
matrix on a number of different worksheets, each with its own name

In the VBA, I define a new variable rng_MXGdata:

rng_MXGdata = [rng_MXGdataSemiAnnual]

This new variable is not recognised as a name in the names collection.
I tried using the following:

Names.Add Name:="rng_MGXdata", RefersToLocal:=rng_MGXdata

but it doesn't seem to make rng_MXGdata appear in the dropdown box.
Perhaps this is because you can't have two names referring to the same
ranges? Do I have to delete rng_MXGdataSemiAnnual from the names
collection before rng_MGXdata can be recognised? I need it as part of
the name collection so I can use it in commands like the following:

Offset(3).Formula = "=VLOOKUP(R[-3]C,rng_MXGdata,3,FALSE)"

I will also need to finally delete rng_MXGdata from the "workspace" and
restore the original rng_MXGdataSemiAnnual so if anyone can suggest how
to do go about this I would be grateful.

Your help is appreciated.

Thanks,

Edward


--
brachistochrone
------------------------------------------------------------------------
brachistochrone's Profile: http://www.excelforum.com/member.php...o&userid=34274
View this thread: http://www.excelforum.com/showthread...hreadid=540353

 
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
Adding a collection to a wksht CLamar Excel Discussion (Misc queries) 1 June 23rd 06 04:31 PM
Adding to a Collection Cody Excel Programming 0 September 2nd 05 07:08 PM
code to add a name to the names collection and assign a reference keithb Excel Programming 2 August 5th 05 06:38 AM
Adding Range to Worksheet Names Collection Keith Willshaw Excel Programming 2 March 5th 04 09:17 AM
Names Collection MarkC[_2_] Excel Programming 2 January 28th 04 10:47 AM


All times are GMT +1. The time now is 10:57 PM.

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"