View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Herbert Herbert is offline
external usenet poster
 
Posts: 23
Default User Guided Button???

Hello"

The statement
Worksheets("Pub").Activate
tries to activate a worksheet called "Pub", which most likely doesn't exist

Just omit the quotation marks:
Worksheets(Pub).Activate

Herbert

"locutus243" wrote:


Hi guys,

I have 100 worksheets all with different names and a main menu. From
the main menu I want to be able to press a button that opens an input
box in which I can type the name of the worksheet I want to go to and
then a macro will take me to that worksheet.

I've been experimenting and have the following code in VB. It brings up
an input box but then whenever I enter anything and click OK, an error
message appears. Could anyone give me a hand???

Thanks

Mark

Heres my code:-

Sub RoundToZero()
Worksheets("Main Page").Activate
On Error GoTo PressedCancel
Set Pub = Application.inputbox( _
prompt:="Enter your EKR Pubn Code", _
Type:=0)
Worksheets("Pub").Activate

Exit Sub

PressedCancel:
Resume
End Sub


--
locutus243
------------------------------------------------------------------------
locutus243's Profile: http://www.excelforum.com/member.php...o&userid=12862
View this thread: http://www.excelforum.com/showthread...hreadid=483423