Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how to open a Workbook and activate a specific sheet

If it is a Forms commandbutton you could use the Caller property

Workbooks.Open Filename:="C:\myDir\myFile.xls"
Select Case Application.Caller
Case "Button 1": Worksheets("Sheet1").Activate
Case "Button 2": Worksheets("Sheet2").Activate
End Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kanan" wrote in message
...
Hi,
I have a situation... where I have to open workbook1 which has 10 sheets
(sheet1...sheet10) from another workbook2 using different commandbuttons.
The question is how do I open workbook1 and activate different sheets

based
on the command button. Is there anyway to pass the sheet name as an

argument.
or Are there any other methods? My workbook1 does have an auto_open macro.

Kanan



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
open workbook to specific sheet Mr E[_2_] Excel Worksheet Functions 1 April 9th 10 06:53 PM
Using a Windows Shortcut to Open to Specific Sheet in Workbook Staying Productive Excel Discussion (Misc queries) 4 December 22nd 09 04:37 PM
How do I open a workbook in a specific sheet PetterSn Excel Discussion (Misc queries) 3 January 12th 06 06:44 AM
how to open a Workbook and activate a specific sheet Bigwheel Excel Programming 0 August 17th 04 09:04 PM
Write a Shortcut to Open Excel Workbook at a Specific Sheet SidBord Excel Programming 0 June 2nd 04 11:10 PM


All times are GMT +1. The time now is 09:16 PM.

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"