+ Reply to Thread
Results 1 to 6 of 6

User guided button???

  1. #1
    Registered User
    Join Date
    08-09-2004
    Posts
    6

    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

  2. #2
    Registered User
    Join Date
    08-09-2004
    Posts
    6

    Getting There

    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

  3. #3
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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
    >




  4. #4
    Registered User
    Join Date
    08-09-2004
    Posts
    6

    wrong number of arguments

    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

  5. #5
    Bob Phillips
    Guest

    Re: User guided button???

    It works here.

    --

    HTH

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


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > 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" <[email protected]>

    wrote
    > in message news:[email protected]...
    > >
    > > 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
    > >

    >
    >




  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Bob's code works for me also if I change 'Main Page' to Sheet1 and reply Sheet2 to the prompt


    Quote Originally Posted by Bob Phillips
    It works here.

    --

    HTH

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


    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > 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" <[email protected]>

    wrote
    > in message news:[email protected]...
    > >
    > > 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
    > >

    >
    >

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1