Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a worksheet with a button?
Hi Everybody:
I have 2 worksheets in a workbook. One acts like a main menu and the other is like the data table. I created a button in the main menu...but i'm stuck. My question is how do I code the command button to open up that other worksheet(data table)? Joe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening a worksheet with a button?
in design mode, double click on the button to get to the click event in the
code module of the sheet where the button is located. Or in any mode, right click on the sheet tab and select view code, then( at the top of the module) in the left dropdown select CommandButton1 and in the right select Click Private Sub CommandButton1_Click( ) End Sub should be entered in the module. Put in code something like this untested pseudo code. Private Sub CommandButton1_Click() Dim wkbk as workbook On Error Resume Next set wkbk = Workbooks("Data Table.xls") On Error goto 0 if wkbk is nothing then Workbooks.Open ThisWorkbook.Path & "\Data Table.xls" ThisWorkbook.Activate End if End Sub Regards, Tom Ogilvy "joe" wrote in message ... Hi Everybody: I have 2 worksheets in a workbook. One acts like a main menu and the other is like the data table. I created a button in the main menu...but i'm stuck. My question is how do I code the command button to open up that other worksheet(data table)? Joe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
when opening excell a Insert Visio Button pages opensHow 2 stopit | Setting up and Configuration of Excel | |||
opening a worksheet with a command button on a form | Excel Discussion (Misc queries) | |||
Opening Worksheet | Excel Discussion (Misc queries) | |||
print different worksheet by pressing visible button on worksheet | Excel Worksheet Functions | |||
Opening a New Worksheet | New Users to Excel |