Link to home
Start Free TrialLog in
Avatar of csehz
csehzFlag for Hungary

asked on

VBA Excel 2010 - ActiveWorkbook.Name

Dear Experts,

Could you please advise how to write a check in VBA, which would analyse the active workbook name whether the file name contains characters "OVD"?

So for example if the file name is "OVD_0922.xlsx" in that case the answer is True, if "Book1.xls" in that case False.

thanks,
Avatar of Norie
Norie

Something like this perhaps.

If ActiveWorkbook.Name Like "*OVD*" Then
   MsgBox "The active workbook had OVD in it's name
End If

ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of csehz

ASKER

Thanks it works