I am currently pulling a directory of files to cycle through them one by one using the following code
This is only looking for .xlsx files but I want to set it up to look for either .xlsx or .xlsm files. IS there an easy way to do that without having to run the code twice. Can I simply search for *.xls*?
VBA Code:
Set fileNamesCollection2 = New Collection
MyFile2 = Dir(strP & "\*.xlsx", vbDirectory)
Do While MyFile2 <> ""
fileNamesCollection2.Add MyFile2
MyFile2 = Dir
Loop
This is only looking for .xlsx files but I want to set it up to look for either .xlsx or .xlsm files. IS there an easy way to do that without having to run the code twice. Can I simply search for *.xls*?