If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Get an instance of a sheet from codename string?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-09, 10:38
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
Get an instance of a sheet from codename string?

I have a lookup that returns a string Code name of a wks say sheet3

is there a way I can get a worksheet object referencing sheet3 from a string?

something like

Dim wks as worksheet
wks = activeworkbook.sheetsFromCodeName("Sheet3") ?
Reply With Quote
  #2 (permalink)  
Old 07-14-09, 06:30
Kafrin Kafrin is offline
Registered User
 
Join Date: Apr 2009
Posts: 14
I think you're saying that you will have a variable that (using a lookup) contains the sheet name as a string, so you want something like:

Dim wks as Worksheet
wks = ActiveWorkbook.Sheets(VariableHoldingSheetName)
__________________
K

Software Matters: Excel Design
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On