In the code below I have a MsgBox if a particular Workbook isn't open, and I would like to add another MsgBox if more than one Workbook is open that fits the criteria.
My guess is adding something like
VBA Code:
Sub set_transcript_wbk()
Dim MyWkb As Workbook
Dim wkb As Workbook
For Each wkb In Workbooks
If wkb.Name Like "Transcript*.xls" Then
Set MyWkb = Workbooks(wkb.Name)
Exit For
End If
Next wkb
If MyWkb Is Nothing Then
MsgBox "Please open your Transcript file", vbExclamation
End If
End Sub
My guess is adding something like
VBA Code:
If Not MyWkb Is Nothing Then
MsgBox "Please close all but one Transcript file and re-run macro", vbExclamation