Results 1 to 4 of 4

Thread: help with excel

  1. #1
    ATommasi
    Guest
    I'm using VBA in excel and I ran into a problem
    I have the name of a worksheet in a variable and what I want to do is activate that worksheet using the variable.
    Does anyone have any ideas?

  2. #2
    Lively Member xhomerx's Avatar
    Join Date
    Feb 2001
    Posts
    98

    Wink

    sheetname = "Sheet3"
    Sheets(sheetname).Select

  3. #3
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    just tried this...should work fine

    Code:
    Private Sub CommandButton1_Click()
    x = "Sheet2"
    Sheets(x).Select
    End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    Guest
    Thanks. it works!

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