#1   Report Post  
Posted to microsoft.public.excel.misc
nc nc is offline
external usenet poster
 
Posts: 119
Default Sheet name

Hi

Is there a macro that list all the sheet's names of a workbook in
alpabetical order and by double clicking the relevant name on the list select
the worksheet.

Or

Macro that can find/select worksheet by key words in the worksheetname.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Sheet name

Hi,

Right click any sheet tab, view code and paste this in and run it

Sub sonic()
Sheets("Sheet1").Select
For x = 1 To Worksheets.Count
Cells(x, 1).Hyperlinks.Add Anchor:=Cells(x, 1), Address:="", _
SubAddress:=Worksheets(x).Name & "!A1", TextToDisplay:=Worksheets(x).Name
Next
lastrow = Sheets("sheet1").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A1:A" & lastrow).Sort Key1:=Range("A1"), Order1:=xlAscending
End Sub

Mike

"nc" wrote:

Hi

Is there a macro that list all the sheet's names of a workbook in
alpabetical order and by double clicking the relevant name on the list select
the worksheet.

Or

Macro that can find/select worksheet by key words in the worksheetname.

  #3   Report Post  
Posted to microsoft.public.excel.misc
nc nc is offline
external usenet poster
 
Posts: 119
Default Sheet name

Hi Mike

Thanks. It works except for sheet names with a spaces within it. I get the
message box, "Reference ids not valid".

Is there a way I can fix the macro?

Thanks.



"Mike H" wrote:

Hi,

Right click any sheet tab, view code and paste this in and run it

Sub sonic()
Sheets("Sheet1").Select
For x = 1 To Worksheets.Count
Cells(x, 1).Hyperlinks.Add Anchor:=Cells(x, 1), Address:="", _
SubAddress:=Worksheets(x).Name & "!A1", TextToDisplay:=Worksheets(x).Name
Next
lastrow = Sheets("sheet1").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A1:A" & lastrow).Sort Key1:=Range("A1"), Order1:=xlAscending
End Sub

Mike

"nc" wrote:

Hi

Is there a macro that list all the sheet's names of a workbook in
alpabetical order and by double clicking the relevant name on the list select
the worksheet.

Or

Macro that can find/select worksheet by key words in the worksheetname.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Sheet name

See response in other thread, you need to enclose worksheet name in single
quotes.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"nc" wrote in message
...
Hi Mike

Thanks. It works except for sheet names with a spaces within it. I get
the
message box, "Reference ids not valid".

Is there a way I can fix the macro?

Thanks.



"Mike H" wrote:

Hi,

Right click any sheet tab, view code and paste this in and run it

Sub sonic()
Sheets("Sheet1").Select
For x = 1 To Worksheets.Count
Cells(x, 1).Hyperlinks.Add Anchor:=Cells(x, 1), Address:="", _
SubAddress:=Worksheets(x).Name & "!A1", TextToDisplay:=Worksheets(x).Name
Next
lastrow = Sheets("sheet1").Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A1:A" & lastrow).Sort Key1:=Range("A1"), Order1:=xlAscending
End Sub

Mike

"nc" wrote:

Hi

Is there a macro that list all the sheet's names of a workbook in
alpabetical order and by double clicking the relevant name on the list
select
the worksheet.

Or

Macro that can find/select worksheet by key words in the worksheetname.



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
Duplicate sheet, autonumber sheet, record data on another sheet des-sa[_2_] Excel Worksheet Functions 0 May 8th 08 06:56 PM
"='sheet 1'!D4" auto fill sheet to sheet ='sheet 2'!D4 mistewalker Excel Worksheet Functions 5 January 6th 08 11:36 PM
create a formula in one sheet that would read data from separate sheet automatically QD Excel Discussion (Misc queries) 0 December 8th 06 04:17 AM
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
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM


All times are GMT +1. The time now is 12:44 AM.

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"