Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating a ComboBox | Excel Programming | |||
Populating combobox/listbox | Excel Programming | |||
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! | Excel Programming | |||
Populating ComboBox Methods | Excel Programming | |||
Populating Combobox Methods | Excel Programming |