p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Excel VBA (http://p2p.wrox.com/forumdisplay.php?f=79)
-   -   selecting named ranges from an array (http://p2p.wrox.com/showthread.php?t=50212)

TheBFJ November 13th, 2006 07:15 AM

selecting named ranges from an array
 
Hi

I have an array of strings representing named ranges. I want to use these strings to select the ranges like this:

Range(rangeNames(i) ).Select

but it generates an error. Am I on the right track or is this type of operation impractical or impossible in VBA?

Thanks in advance

Shasur November 13th, 2006 07:35 AM

Just prefiz the Range with the Sheet Object

Like

Activesheet.Range(rangeNames(i) ).Select

or

Worksheets(1).Activesheet.Range(rangeNames(i) ).Select

It should work

Cheers
Shasur

http://www.vbadud.blogspot.com


All times are GMT -4. The time now is 06:31 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.