#1   Report Post  
Jim May
 
Posts: n/a
Default Before Double-Click

In my worksheet named "Index" - I have the names of all my worksheets (up to
date)
Some names include spaces. I'd like to be able to Double-Click on
a name (text) and have that worksheet become active. I've been toying
around now for an hour - in google, in help, close, but no cigar...
Can you assist?
TIA


  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Check out David McRitchie's BuildTOC macro:

http://www.mvps.org/dmcritchie/excel/buildtoc.htm


Alternatively, select the cells with the names and choose
Insert/Hyperlink. Click the Document tab and in the Anchor textbox,
enter the sheetname!cellreference, with sheet names with spaces in
single quotes, e.g.:

Sheet2!A1
'Spaces in Title'!A1
NoSpacesNeeded!J10

Click OK

Note: Hyperlinks only take a single click to jump to their destination.

If you really want to double click, you'll need to use an event macro:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
If Target.Column = 1 Then
On Error Resume Next
Sheets(CStr(Target.Value)).Select
Cancel = True
On Error GoTo 0
End If
End Sub

Put that in your worksheet code module (right-click the worksheet tab
and choose View Code). Change the column number if you worksheet names
aren't in column A.



In article <t3Xwd.6677$jn.3778@lakeread06, "Jim May"
wrote:

In my worksheet named "Index" - I have the names of all my worksheets (up to
date)
Some names include spaces. I'd like to be able to Double-Click on
a name (text) and have that worksheet become active. I've been toying
around now for an hour - in google, in help, close, but no cigar...
Can you assist?
TIA

  #3   Report Post  
Jim May
 
Posts: n/a
Default

Thanks JE, the event-macro you offered did the trick.

"JE McGimpsey" wrote in message
...
Check out David McRitchie's BuildTOC macro:

http://www.mvps.org/dmcritchie/excel/buildtoc.htm


Alternatively, select the cells with the names and choose
Insert/Hyperlink. Click the Document tab and in the Anchor textbox,
enter the sheetname!cellreference, with sheet names with spaces in
single quotes, e.g.:

Sheet2!A1
'Spaces in Title'!A1
NoSpacesNeeded!J10

Click OK

Note: Hyperlinks only take a single click to jump to their destination.

If you really want to double click, you'll need to use an event macro:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
If Target.Column = 1 Then
On Error Resume Next
Sheets(CStr(Target.Value)).Select
Cancel = True
On Error GoTo 0
End If
End Sub

Put that in your worksheet code module (right-click the worksheet tab
and choose View Code). Change the column number if you worksheet names
aren't in column A.



In article <t3Xwd.6677$jn.3778@lakeread06, "Jim May"
wrote:

In my worksheet named "Index" - I have the names of all my worksheets

(up to
date)
Some names include spaces. I'd like to be able to Double-Click on
a name (text) and have that worksheet become active. I've been toying
around now for an hour - in google, in help, close, but no cigar...
Can you assist?
TIA



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
adding an option to the right click menu kontiki Excel Discussion (Misc queries) 1 December 16th 04 07:06 PM
Click on X in upper right corner should save FIRST the file you se Thorkild Excel Discussion (Misc queries) 1 December 6th 04 11:54 PM
how do I create comma and double quote delimited file mikeb Excel Discussion (Misc queries) 1 November 29th 04 10:01 PM
Why do my text boxes disappear from my chart when I click out? Robboo Charts and Charting in Excel 1 November 27th 04 05:49 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM


All times are GMT +1. The time now is 07:13 AM.

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

About Us

"It's about Microsoft Excel"