PC Review


Reply
Thread Tools Rate Thread

Define sheet name then select sheet

 
 
merry_fay
Guest
Posts: n/a
 
      13th Dec 2007
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
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      13th Dec 2007
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)


"merry_fay" <(E-Mail Removed)> wrote in message
news:8F452ED2-C617-4131-91B3-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Carim
Guest
Posts: n/a
 
      13th Dec 2007
Hi,

Just try :

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

HTH
 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      13th Dec 2007
Sub selectsheetfromcellvalue()
Sheets(ActiveCell.Value).Select
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"merry_fay" <(E-Mail Removed)> wrote in message
news:8F452ED2-C617-4131-91B3-(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between 'Select' a sheet and 'Activate' a sheet RJQMAN Microsoft Excel Programming 9 30th Oct 2010 05:22 AM
Select a Sheet Issue in VBA on a very hidden sheet - fails christopher ward Microsoft Excel Programming 6 21st Jul 2009 01:30 PM
Select sheet, Pause till Enter pressed, return to previous sheet Russ3Z Microsoft Excel Programming 1 12th Jun 2007 11:06 PM
How do I select price from sheet.b where sheet.a part no = sheet.b =?Utf-8?B?U29ubnk=?= Microsoft Excel Worksheet Functions 4 4th Apr 2006 05:08 PM
Use Sheet CodeNames to Select Sheet in Different Workbook Randy Microsoft Excel Misc 1 10th Jun 2005 12:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.