Define sheet name then select sheet

  • Thread starter Thread starter merry_fay
  • Start date Start date
M

merry_fay

Hiya,

I've typed the name of the sheet I want to go to in a cell in excel & used
the macro to define it, but then I can't seem to get the code right for using
that definition to activate the sheet.

sheet_name = ActiveCell.Value
Sheet sheet_name.Select (I've tried lots of different ways of writing this...)

Can anyone help?

Thanks
merry_fay
 
Try

ThisWorkbook.Sheets(sheet_name).Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
Hi,

Just try :

Dim sheet_name As String
sheet_name = ActiveCell.Value
Sheets(sheet_name).Select

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top