View Single Post
  #1   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

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