I am looking to loop through all the files in a specific folder to sum the values of each file into the workbook where this module is stored. The files to be looped through are identical. The folder path is set as a variable strPath. The code I have to start is:
I'm hoping the above is how to start into the loop which will go through the files. However, if there's a better way, I'm certainly interested.
Then, I'm wondering how should the syntax look to sum up the range values to be entered into the current open workbook where the macro is running?
Thank you for your help.
Code:
Sub LoopThruFiles()
Dim strPath as String
chDir StrPath
Fname = Dir("*.xls*")
While Fname <> ""
I'm hoping the above is how to start into the loop which will go through the files. However, if there's a better way, I'm certainly interested.
Then, I'm wondering how should the syntax look to sum up the range values to be entered into the current open workbook where the macro is running?
Thank you for your help.