• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Opening a spreadsheet using a form

tazz

Member
Hello all,
I have a workbook with a lot of spreadsheets and I created a small form to open the spreadsheet that I type in textbox. This form has only 1 text box and 1 cmdbutton.
This is the code I used for the cmd button:


Private Sub cmdOpen_Click()
ActiveWorkbook.Sheets("Sheet").Activate
Sheet.value=txtPiece.value
Unload Me
End Sub

I have a message of error and I know that is something wrong with line 2 but I don't know exactly what.
Any suggestions?
Thank you.
 
I think the below should help you..

try using this..

Code:
Private Sub CommandButton1_Click()
dx = UserForm1.TextBox1.Value
Sheets(dx).Select
Unload Me
End Sub
 
Back
Top