Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default a macro that launches another workbook automatically

hey folks,

here's the deal. i need a macro that can sit on a sheet in a master
workbook and when i type a number (a filename) into a cell, lets say
cell D3, and then press enter, i need this macro to automatically open
the file i just typed. for instance, if i type in "406" into the cell
D3. when i press enter i want file 406.xls to open and minimize (so
that i can have access to information in that workbook).

thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default a macro that launches another workbook automatically

Use the Change event for that sheet.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim bk as Workbook
If Target.Address = "$D$3" then
if not isempty(Target) then
set bk = workbooks.Open( Target.Value)
bk.Windows(1).WindowState = xlMinimized
End if
end if
End Sub

Right click on the sheet tab and select view code. Then put in a procedure
like the above. (you can paste this one in for a start.) You may need to
specify the path and so forth.

--
Regards,
tom Ogilvy



"mtjarrett" wrote in message
ups.com...
hey folks,

here's the deal. i need a macro that can sit on a sheet in a master
workbook and when i type a number (a filename) into a cell, lets say
cell D3, and then press enter, i need this macro to automatically open
the file i just typed. for instance, if i type in "406" into the cell
D3. when i press enter i want file 406.xls to open and minimize (so
that i can have access to information in that workbook).

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default a macro that launches another workbook automatically

thanks

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
Set macro to run automatically when closing workbook? Wuddus Excel Discussion (Misc queries) 10 January 20th 15 03:39 PM
Run a macro automatically on workbook open tweacle Excel Worksheet Functions 2 February 25th 06 06:38 PM
Macro add worksheet to workbook automatically Davin Excel Discussion (Misc queries) 0 February 17th 06 05:36 PM
Macro launches after activating a range of cells Martin Excel Programming 2 January 6th 05 11:21 AM
Excel Workbook automatically (by design) runs a macro Chip Pearson Excel Programming 0 August 5th 04 08:24 PM


All times are GMT +1. The time now is 01:05 PM.

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

About Us

"It's about Microsoft Excel"