ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   User guided button??? (https://www.excelbanter.com/excel-discussion-misc-queries/54444-user-guided-button.html)

locutus243

User guided button???
 

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.
Is this possible, I've been looking for a way but am relatively rubbish
with Excel. Any help would be greatly appreciated...

Thanks for your time

Mark


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


locutus243

User guided button???
 

Hey guys,

I've been experimenting since my post 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=483414


Bob Phillips

User guided button???
 
Sub RoundToZero()
Dim Pub
Worksheets("Main Page").Activate
On Error GoTo PressedCancel
Pub = InputBox( _
prompt:="Enter your EKR Pubn Code")
Worksheets(Pub).Activate

Exit Sub
PressedCancel:
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"locutus243" wrote
in message ...

Hey guys,

I've been experimenting since my post 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=483414




locutus243

User guided button???
 

Hey,

Thanks for your help. I tried your script but it said that there was a
wrong number of arguments or invalid property assignments on the 'Pub =
input( _' line.

What does this mean??

Thanks

Mark


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


Bob Phillips

User guided button???
 
It works here.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
Sub RoundToZero()
Dim Pub
Worksheets("Main Page").Activate
On Error GoTo PressedCancel
Pub = InputBox( _
prompt:="Enter your EKR Pubn Code")
Worksheets(Pub).Activate

Exit Sub
PressedCancel:
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"locutus243"

wrote
in message ...

Hey guys,

I've been experimenting since my post 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=483414






Bryan Hessey

User guided button???
 

Bob's code works for me also if I change 'Main Page' to Sheet1 and reply
Sheet2 to the prompt


Bob Phillips Wrote:
It works here.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bob Phillips" wrote in message
...
Sub RoundToZero()
Dim Pub
Worksheets("Main Page").Activate
On Error GoTo PressedCancel
Pub = InputBox( _
prompt:="Enter your EKR Pubn Code")
Worksheets(Pub).Activate

Exit Sub
PressedCancel:
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"locutus243"


wrote
in message

...

Hey guys,

I've been experimenting since my post 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=483414





--
Bryan Hessey
------------------------------------------------------------------------
Bryan Hessey's Profile: http://www.excelforum.com/member.php...o&userid=21059
View this thread: http://www.excelforum.com/showthread...hreadid=483414



All times are GMT +1. The time now is 06:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com