Results 1 to 4 of 4

Thread: Macro to show Worksheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Sep 2010
    Posts
    4
    Location

    Macro to show Worksheet

    Hi Guys,

    I have a cmd button when clicked promts the user for a client ID. A exel sheet is presented after populated by data based on the client ID.

    my logic in this is to have a inputbox attached to a variable (obviously) but is there someway to have the excel sheet use this variable as well?

    im also having trouble with the actual code to get the worksheet to pop up after the input box is filed.

    havnt done much but incase anyone needs it.

    [vba]Private Sub cmdReport_Click()
    Dim varInput As String
    Dim varWorksheet As Worksheet
    Set varWorksheet = Application.Workbooks("work.xls").Worksheets("Report1")

    MainMenu.Hide
    varInput = InputBox("Please enter your client ID")
    varWorksheet.Show?

    End Sub[/vba]
    Last edited by NRG; 10-02-2010 at 05:57 PM.

Posting Permissions

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