selecting a worksheet page

J

Jim T.

I can use the following code on a button on the cover sheet, but how do I
modify it if I want to use it in a form? When I use it it seems to see right
through it and click on the form itself.

Sub ShowSheetList()

On Error Resume Next
If ActiveWorkbook.Sheets.Count <= 16 Then
Application.CommandBars("Workbook Tabs"). _
ShowPopup 500, 225
Else
Application.CommandBars("Workbook Tabs"). _
Controls("More Sheets...").Execute
End If
On Error GoTo 0

End Sub
 
J

JLGWhiz

It is much more simple to put a new button on the form and then attach the
macro to it. You can then delete the old button.
 
J

Jim T.

I tried using a new button but when it pops up and I click on a sheet nothing
happens except the pop up window disappears. Any other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top