This should be a simple one for you guys...
Im new to using VBA/Macro but what I would like to be able to do is have a button (From Control or Form Tool Box?) That when its clicked it takes you to another sheet in the workbook or you know brings it into focus.
Also since Im already asking for help, I also need to do one that opens another workbook.
*edit*
Im using Excel 02
*edit*
Disregard first part I found it here:
http://www.excelforum.com/excel-new-users/337566-how-to-open-a-workbook-with-a-specific-worksheet-displayed-by-defa.html
But I still could use help on doing this for a workbook...Worksheets("Sheet2").Activate
(click button and another workbooks opens)
Thanks in advance for any help,
Jim
Last edited by JimSolo; 05-20-2007 at 11:31 AM.
Hello Jim
Will it always be the same workbook, or do you want to dynamically select which workbook to open every time the code is run? If the former, then code as simple as:
If the latter then maybe:Set wb = Workbooks.Open("MyWorkbookPath&Name")
Hope this helps!Dim fName, wb As Workbook fName = Application.GetOpenFileName() If fName<>False Then Set wb = Workbooks.Open(fName) End If
Richard
Well I tried what you said and got a compile error
Heres what my code looks like:
Private Sub CommandButton2_Click()
Set wb = Workbooks.Open("C:\Documents and Settings\Jim\My Documents\LawnBarbers\Customer Database.xls")
Sheets ("")
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks