Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Define sheet name then select sheet

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Define sheet name then select sheet

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" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 510
Default Define sheet name then select sheet

Hi,

Just try :

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

HTH
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using cells to define sheet references patrickgamer Excel Discussion (Misc queries) 1 April 27th 06 08:55 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
open at define work sheet kit Excel Discussion (Misc queries) 3 October 23rd 05 03:57 PM
Use Sheet CodeNames to Select Sheet in Different Workbook Randy Excel Discussion (Misc queries) 1 June 10th 05 12:17 AM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM


All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"