Indirect Sheet Ref in VBA

somesoldiers

Board Regular
Joined
Feb 23, 2008
Messages
199
Hi All

instead of Sheets("Jan 2011").Select would like to use INDIRECT ref "'"&$P$8"'!" in code instead of Jan 2011 so that when user picks month from dropp down the macro will know to reference this sheet- any ideas appreciated

Thanks
Noel
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Would this work?
Code:
Dim iSheet as String
iSheet = Range("P8")
Sheets(iSheet).Select
 
Upvote 0
Thanks Guys

Just 1 thing, my sheets are named Jan 2011, Feb 2011 etc have a drop down in P8 with all months formatted as mmm yyyy but vba is reading as 01/01/2011 so is not picking up sheet. Is there a quick way round this?
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top