Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Joel - I will give it a try!!
"Joel" wrote in message ... Sub getbooks() folder = "\\SVR-SBS\FolderName\Folder" Response = InputBox("Enter Year : ") If Response < "" Then folder = folder & Response & "\" FName = Dir(folder & "*.xls") Do While FName < "" Set bk = Workbooks.Open(filename:=folder & FName) 'enter your code here bk.Close savechanges:=False FName = Dir() Loop Else MsgBox ("Cannot OPen the year - Exiting Sub") End If End Sub "MurrayB" wrote: I have 30 excel workbooks for each year, say year 6,7 and 8, so in total 90 workbooks. Each of the workbooks are stored in this pathname ending in the year for instance for Year 6 it would be this :- \\SVR-SBS\FolderName\Folder6 I want to write a Macro to be able to open all the workbooks for one year where an InputBox asks me which year I need and the answer then causes the macro to open all 30 workbooks in whatever year I want. Firstly, is there a way I can list the names of all the workbooks and secondly if I cant, how do I write code that will only go through the list of files once, based on the path obtained from the InputBox? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
More if then logic | Excel Worksheet Functions | |||
If Then Logic | Excel Worksheet Functions | |||
LOGIC | Excel Discussion (Misc queries) | |||
If Then logic not enough | Excel Discussion (Misc queries) | |||
IRR Logic | Excel Worksheet Functions |