shahdelsol
Active Member
- Joined
- Jul 21, 2009
- Messages
- 276
- Office Version
- 365
- Platform
- Windows
So I am using this code to activate a workbook with partial name and it works great. What I am trying to add is if workbook cannot be found I would get a msg box that says " file is not open"
Here is what I added that didn't work:
Code:
Dim wb As Workbook
For Each wb In Application.Workbooks
If wb.Name Like "partial name*" Then wb.Activate
Next wb
Here is what I added that didn't work:
Code:
If wb is nothing then
MsgBox "file is not open"
Last edited: