View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
KP[_4_] KP[_4_] is offline
external usenet poster
 
Posts: 43
Default List all sheets in the work book and select by double click

Thanks to all of you.

I have never worked with User Forms before, so I will take a look of that
during the next couple of days. It seems as if it is a good solution.

If I don't succeed I think the Hyperlink method can be used.

Regards,
Kaj Pedersen


"KP" <none skrev i en meddelelse
b.com...
Hi,

I need a macro to list all sheets in a workbook and be able to select from
the list by double clicking the name of the sheet.
(I am already aware of the possibility to right click the symbol left
corner in Excel).

The code below almost does the job, but I have to write the number
corresponding to the sheet and press enter.
Can somebody help with the code, so that I can double click the name.

Kaj Pedersen

myShts = ActiveWorkbook.Sheets.Count
For i = 1 To myShts
myList = myList & i & " - " & ActiveWorkbook.Sheets(i).Name & " " & vbCr
Next i
Dim mySht As Single
mySht = InputBox("Select sheet to go to." & vbCr & vbCr & myList)
Sheets(mySht).Select