Hi Guys,
I am trying to use an If Or statement but seem to be having a problem.
There could be a filenamed TEST or it could be Test.
I need a message box to tell the user if the ActiveWorkbook.Name is NOT TEST or Test
This works if the file is named Test.xlsm.
If ActiveWorkbook.Name <> "Test.xlsm" Then
This works if the file is called TEST.xlsm.
If ActiveWorkbook.Name <> "TEST.xlsm" Then
This does NOT work, always shows the message box, even if the active workbook is either of the filenames.
If ActiveWorkbook.Name <> "Test.xlsm" OR ActiveWorkbook.Name <> "TEST.xlsm" Then
MsgBox "The workbook is NOT called TEST or Test", vbCritical, Title:="Error"
Exit Sub
End If
Bookmarks