ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding Worksheet Name (https://www.excelbanter.com/excel-programming/297789-re-finding-worksheet-name.html)

Bob Phillips[_6_]

Finding Worksheet Name
 
Worksheets(myVar & "_" & Year(Date)).Activate

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Lenny" wrote in message
...
Hi all, I have a question that I hope someone can help me with.
I'm on an company intranet which has a sharedrive. Every month there is a

excel spreadsheet created with safety data. I have another worksheet with VB
code that extracts the date into a 3 letter format (i.e, Apr.) which I put
into a variable. My question is how do I open another workbook which has
worksheet with (i,e., Apr_2004) as one of the 12 months in it. I can open
the workbook but I need to know how to select the worksheet based on my
variable which contains the(Apr) name that I'm looking for.

Thanks,
lenny




Flystar[_12_]

Finding Worksheet Name
 
Also try this:

Worksheets(myVar & "_" & Format(Year(myDate),"yyyy")).Selec

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com