ExcelNooberino
New Member
- Joined
- Jan 2, 2019
- Messages
- 43
- Office Version
- 2016
- Platform
- Windows
So I've been working on a macro for my personal use really and I added some errors with MsgBoxes to prevent myself from making a silly mistake. The thing is I have two different erros in a row (consecutive errors) and I want to show just one of the MsgBoxes. Instead of that I'm getting one MsgBox from the first error and when I close that box the second one appears as well. The thing is I want to show just the first one if the first error is to occur. So far I got this:
Any suggestions?!
Dim ws As Worksheet
On Error Resume Next
Set ws = Sheets("Sheet1")
If Err.Number <> 0 Then
MsgBox "Please import data first", vbInformation, "Importing Error"
Else
'do nothing
End If
If Range("Weekly!G19") = "" Then
MsgBox "Please fill the Obsolete Inventory box!", vbInformation, "Generating Error"
End
Else
'do nothing
End If
Any suggestions?!