Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening Files Using VBA
I have a named range (FilesToOpen) that contains a variable number of
filenames and path (i.e. c:\mydoc\text.xls) that need to be opened (range FileCount contains number of files). What I want to do is have a macro that opens all the files in FilesToOpen range, calculates the original sheet, and then close the files opened by the macro. I've been trying with For and Next and open file Range etc. but am strugling with the syntax. Any help appreciated. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Opening Files Using VBA
Uzytkownik napisal w wiadomosci ups.com... I have a named range (FilesToOpen) that contains a variable number of filenames and path (i.e. c:\mydoc\text.xls) that need to be opened (range FileCount contains number of files). What I want to do is have a macro that opens all the files in FilesToOpen range, calculates the original sheet, and then close the files opened by the macro. I've been trying with For and Next and open file Range etc. but am strugling with the syntax. Any help appreciated. Thanks. Sub test() Dim filename As String For Each cell In Range("a1:a2") filename= "c:\" & cell.Value & ".xls" Workbooks.Open Filename:=filename ..... ... Next filename End Sub hope this help mcg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
show most recent files first when opening excel files | Excel Discussion (Misc queries) | |||
Opening Quattro Pro for Windows files (*.WB1 Files) using Excel 20 | Excel Discussion (Misc queries) | |||
How can I view files chronologically when opening multiple files | Excel Discussion (Misc queries) | |||
Opening Files | Excel Programming | |||
Opening files | Excel Programming |