+ Reply to Thread
Results 1 to 3 of 3

Command button and linking with other sheets in the workbooks

  1. #1
    Ken Vo
    Guest

    Command button and linking with other sheets in the workbooks

    I am trying to make a command button that if clicked will jump the user to
    another sheet and/or file. (e.g. if "Inspection" button is clicked it will
    jump to the Inspection sheet in the same workbook. Help me please. Thanks!

  2. #2
    Norman Jones
    Guest

    Re: Command button and linking with other sheets in the workbooks

    Hi Ken,

    Try:

    '=============>>
    Private Sub CommandButton1_Click()
    Dim WB As Workbook
    Dim SH As Worksheet

    Set WB = ThisWorkbook
    Set SH = WB.Sheets("Inspection")
    SH.Activate
    End Sub
    '<<=============

    To activate a sheet in another (open) workbook, replace:


    Set WB = ThisWorkbook

    with

    SetWB = Workbooks("OtherWorkbook.xls")


    ---
    Regards,
    Norman


    "Ken Vo" <KenVo@discussions.microsoft.com> wrote in message
    news:873F05AB-9E1B-4322-8737-93DEDDFA779D@microsoft.com...
    >I am trying to make a command button that if clicked will jump the user to
    > another sheet and/or file. (e.g. if "Inspection" button is clicked it will
    > jump to the Inspection sheet in the same workbook. Help me please. Thanks!




  3. #3
    Ken Vo
    Guest

    Re: Command button and linking with other sheets in the workbooks

    Thanks for your help Norman, but it didnt work.

    "Norman Jones" wrote:

    > Hi Ken,
    >
    > Try:
    >
    > '=============>>
    > Private Sub CommandButton1_Click()
    > Dim WB As Workbook
    > Dim SH As Worksheet
    >
    > Set WB = ThisWorkbook
    > Set SH = WB.Sheets("Inspection")
    > SH.Activate
    > End Sub
    > '<<=============
    >
    > To activate a sheet in another (open) workbook, replace:
    >
    >
    > Set WB = ThisWorkbook
    >
    > with
    >
    > SetWB = Workbooks("OtherWorkbook.xls")
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    > "Ken Vo" <KenVo@discussions.microsoft.com> wrote in message
    > news:873F05AB-9E1B-4322-8737-93DEDDFA779D@microsoft.com...
    > >I am trying to make a command button that if clicked will jump the user to
    > > another sheet and/or file. (e.g. if "Inspection" button is clicked it will
    > > jump to the Inspection sheet in the same workbook. Help me please. Thanks!

    >
    >
    >


+ 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