![]() |
Opening a series of files
I have a macro that runs through a series of automatically generated data and
then calculates utilization. Every day has a different file. I would like to set it up to open every file for the month and make the calculations. Can you help with this? Thanks. |
Opening a series of files
Depends how you know which files to open.
If it only some files in a folder you can use: Dim RetVal As Variant Application.GetOpenFilename(MultiSelect:=True) so the user can select all of those of interest Or if it is all the file in a particular folder Dim Filename As String FileName=Dir(RequiredFolder & "\*.xls) Do While Filename<"" 'Do you stuff FileName=Dir() Loop Either way, if you need to process the files in a specific order, you will need to sort the file names in that order then open them in turn. If not, then open-process-close as you find them. NickHK "joshroberts" wrote in message ... I have a macro that runs through a series of automatically generated data and then calculates utilization. Every day has a different file. I would like to set it up to open every file for the month and make the calculations. Can you help with this? Thanks. |
Opening a series of files
Can you explain to me how to open each file and make that sheet the
activesheet so I can read through the data with my program? Thanks. "NickHK" wrote: Depends how you know which files to open. If it only some files in a folder you can use: Dim RetVal As Variant Application.GetOpenFilename(MultiSelect:=True) so the user can select all of those of interest Or if it is all the file in a particular folder Dim Filename As String FileName=Dir(RequiredFolder & "\*.xls) Do While Filename<"" 'Do you stuff FileName=Dir() Loop Either way, if you need to process the files in a specific order, you will need to sort the file names in that order then open them in turn. If not, then open-process-close as you find them. NickHK "joshroberts" wrote in message ... I have a macro that runs through a series of automatically generated data and then calculates utilization. Every day has a different file. I would like to set it up to open every file for the month and make the calculations. Can you help with this? Thanks. |
Opening a series of files
Never mind I figured it out. Thanks.
"NickHK" wrote: Depends how you know which files to open. If it only some files in a folder you can use: Dim RetVal As Variant Application.GetOpenFilename(MultiSelect:=True) so the user can select all of those of interest Or if it is all the file in a particular folder Dim Filename As String FileName=Dir(RequiredFolder & "\*.xls) Do While Filename<"" 'Do you stuff FileName=Dir() Loop Either way, if you need to process the files in a specific order, you will need to sort the file names in that order then open them in turn. If not, then open-process-close as you find them. NickHK "joshroberts" wrote in message ... I have a macro that runs through a series of automatically generated data and then calculates utilization. Every day has a different file. I would like to set it up to open every file for the month and make the calculations. Can you help with this? Thanks. |
All times are GMT +1. The time now is 01:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com