Results 1 to 5 of 5

Thread: Using the Kies of Kyboard in VBA(excel)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Question Using the Kies of Kyboard in VBA(excel)

    if I click on command button it will execute the code to select sheets(2).I want to execute the code bu using the kye of keyboard example : Alt+Q
    by the way I'm using the button on the sheets not on the Form

    vb Code:
    1. Private Sub CommandButton3_Click()
    2. Sheets(2).Select
    3. End Sub

  2. #2
    Hyperactive Member
    Join Date
    Oct 2010
    Location
    Indiana
    Posts
    457

    Re: Using the Kies of Kyboard in VBA(excel)

    Since you didn't specify what version you are using you'll have to look it up for your version.

    This is for 2003:
    http://office.microsoft.com/en-us/ex...005202306.aspx

  3. #3
    Hyperactive Member
    Join Date
    Oct 2010
    Location
    Indiana
    Posts
    457

    Re: Using the Kies of Kyboard in VBA(excel)

    It's a good idea to use the actual sheet name rather than the index number... If you move sheets around this will cause problems for you.

    Replace "Sheet2" with the name that you have chosen for the sheet
    Code:
    Private Sub CommandButton3_Click()
         Sheets("Sheet2").Select
    End Sub

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: Using the Kies of Kyboard in VBA(excel)

    I'm using Ms 2007

  5. #5
    Hyperactive Member
    Join Date
    Oct 2010
    Location
    Indiana
    Posts
    457

    Re: Using the Kies of Kyboard in VBA(excel)


Posting Permissions

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



Click Here to Expand Forum to Full Width