Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Set macro to run automatically when closing workbook? | Excel Discussion (Misc queries) | |||
Run a macro automatically on workbook open | Excel Worksheet Functions | |||
Macro add worksheet to workbook automatically | Excel Discussion (Misc queries) | |||
Macro launches after activating a range of cells | Excel Programming | |||
Excel Workbook automatically (by design) runs a macro | Excel Programming |