ThrottleWorks
Excel Ninja
Hi,
Whenever I open a file through macro for processing, I do below mentioned check in the file.
I find if the required column headers are present in the file. If headers are present macro resumes work else macro will get close.
I need your help in improving below mentioned code. Can anyone please suggest me how to better this code.
Dear moderator, I hope such kind of posts are allowed, my apologies if these are not allowed.
Please note - This is not urgent.
Whenever I open a file through macro for processing, I do below mentioned check in the file.
I find if the required column headers are present in the file. If headers are present macro resumes work else macro will get close.
I need your help in improving below mentioned code. Can anyone please suggest me how to better this code.
Dear moderator, I hope such kind of posts are allowed, my apologies if these are not allowed.
Please note - This is not urgent.
Code:
On Error Resume Next
TempSht.Range("B1").Select
Cells.Find(What:="SampleString", After:=ActiveCell, LookIn:=xlFormulas, SearchDirection:=xlPrevious).Activate
On Error GoTo 0
If ActiveCell.Value <> "SampleString" Then
MsgBox "It seems 'SampleString' header is not present in .csv file, kindly re-check.", vbCritical
End
End If
Col = ActiveCell.Column