Hye Excel Experts,
I have this part of the macros that actually merge multiple workbooks in a folder. There are certain items need to be filtered in the raw file first before it copies the final one into the master workbook. However, the raw file contributors sometimes park the wrong file content into that folder. However, it is still processed by my macros because it doesn't return error. So, I wish to have the first line of command that actually check through sets of headers in a range of cells and if any of the header names or part of the header names match to a particular string, the macro should directly close the file without save and go to the next file.
Here are parts of what I tried but doesn't work :-
Appreciate if someone with solution could share for mine.
Thanks in advance.
DZ
I have this part of the macros that actually merge multiple workbooks in a folder. There are certain items need to be filtered in the raw file first before it copies the final one into the master workbook. However, the raw file contributors sometimes park the wrong file content into that folder. However, it is still processed by my macros because it doesn't return error. So, I wish to have the first line of command that actually check through sets of headers in a range of cells and if any of the header names or part of the header names match to a particular string, the macro should directly close the file without save and go to the next file.
Here are parts of what I tried but doesn't work :-
Code:
Do While FileName <> ""
Application.ScreenUpdating = False
Workbooks.Open FileName:=myPath & FileName, ReadOnly:=True, local:=True
For Each Sheet In ActiveWorkbook.Sheets
If Range("A1:F1").Value = "Note" Then Resume Next '<<== the condition that I tried but failed
Appreciate if someone with solution could share for mine.
Thanks in advance.
DZ
Last edited: