LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Populating combobox in custom toolbar

Follow up...

Set rngList = Worksheets(y).Range("strRngName")
should read
Set rngList = Worksheets(y).Range(strRngName)
(no quote marks)

Jim Cone



"Jim Cone"
wrote in message
Bill,
I am glad you got it working. However you raised a couple of questions/issues...
1. Module level variables in Class modules are private. So code in another
module won't know about it.
2. I would not use a Range variable with the same name as a Name object.
3. Even if you declare a public variable as a Range (in a standard module),
you must still Set the variable to a specific range before you can refer to it.
4 If you have a named range, that name will be available throughout the project.
So Worksheets(x).Range("rgUniqueStations") should work in all modules.
5. Or if you want to use that named range location on another sheet, you can...
Dim strRngName as String
strRngName = Worksheets(x).Range("rgUniqueStations").Address
Set rngList = Worksheets(y).Range("strRngName")
For lngN = 1 to rngList.Count
---
Jim Cone
San Francisco, USA
 
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
Populating a ComboBox DirInfo Excel Programming 1 March 17th 05 10:03 PM
Populating combobox/listbox Torstein S. Johnsen[_2_] Excel Programming 1 May 13th 04 09:26 AM
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! Kevin Waite Excel Programming 2 March 3rd 04 03:31 PM
Populating ComboBox Methods Todd Huttenstine[_2_] Excel Programming 8 January 19th 04 12:14 AM
Populating Combobox Methods Todd Huttenstine[_2_] Excel Programming 10 January 18th 04 10:19 PM


All times are GMT +1. The time now is 05:45 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"