Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
joe joe is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
when opening excell a Insert Visio Button pages opensHow 2 stopit Insert Visio Button Removal Setting up and Configuration of Excel 0 December 17th 07 05:39 PM
opening a worksheet with a command button on a form gbpg Excel Discussion (Misc queries) 2 September 1st 07 05:40 AM
Opening Worksheet Mike Excel Discussion (Misc queries) 1 October 17th 06 04:21 PM
print different worksheet by pressing visible button on worksheet Confused Excel Worksheet Functions 2 June 13th 05 02:22 PM
Opening a New Worksheet PT New Users to Excel 1 April 13th 05 01:43 AM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"