Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 13th, 2006, 07:15 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old November 13th, 2006, 07:35 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing Workbook Named Ranges in VBA RollingWoodFarm Excel VBA 2 October 4th, 2006 01:54 PM
Drop Down boxes in Cells and selecting ranges tbmbob Excel VBA 0 June 1st, 2006 09:12 AM
Date Ranges nbuckwheat Access 1 December 12th, 2005 12:45 PM
selecting multiple records as one record array Greywacke Classic ASP Databases 1 February 10th, 2004 10:33 AM



All times are GMT -4. The time now is 04:51 PM.


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