Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default basic

Hi Ella,
I like to supply a default when using InputBox, so that you don't have
to necessarily type in anything, in this case a sheetname.

Sub specifysheetname()
Dim response As String
response = Application.Worksheets(1).Name
response = Application.InputBox( _
"Enter the sheetname", _
"Enter sheetname:", response, , , , 1)
If response < "False" Then
On Error Resume Next
Application.Worksheets(response).Activate
If Err.Number = 9 Then MsgBox "no such sheet"
On Error GoTo 0
End If
End Sub

Are you aware that you right click a sheet navigation arrow left
of the sheetnames and select a sheet or "more sheets". Or
a dialog to directly bring up more sheets.
http://www.mvps.org/dmcritchie/excel...htm#moresheets

Sooner or later if you have a lot of sheets you will want to sort the
worksheet tabs.
http://www.mvps.org/dmcritchie/excel...#sortallsheets

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Ella" wrote in message oups.com...
I want to create a macro that creates a pop up box that ask the name of
the worksheet i want to open. What statement do i use?
please help :





 
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
this is probably very basic justjohn Excel Discussion (Misc queries) 1 January 20th 06 12:11 PM
Basic If Trying To Excel Excel Worksheet Functions 4 December 26th 05 02:10 AM
DV basic help cjtj4700 New Users to Excel 5 December 14th 05 12:57 AM
Need some basic help Babio Excel Programming 1 September 22nd 04 05:38 AM
probably 2 basic joe Excel Programming 0 July 24th 03 02:37 AM


All times are GMT +1. The time now is 02:50 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"