Please help, my issue is that the code below works but not for active work book, so when i run the macro from the a open workbook in the same directory, it works for all the files but not for the one thats opened and im running from...
i want it to run for the file thats open too.
i want it to run for the file thats open too.
Code:
Allfolders = MsgBox("Do you want to Run for All files in this folder", vbYesNo)
If Allfolders = vbYes Then
If Right(MyPath, 1) <> Application.PathSeparator Then MyPath = MyPath & Application.PathSeparator
Fname = Dir(MyPath & "*.xlsm")
'loop through the files
Do While Len(Fname)
With Workbooks.Open(MyPath & Fname)
' code here
End With
xFileName = Dir
Loop
End If