matthewjapp
Board Regular
- Joined
- May 14, 2007
- Messages
- 115
Hi there
I have quite a long piece of code with runs things like text to columns and transposing data from a master file off 2 sheets.
The code starts with Sub Refresh() and ends after all the code.
What I am trying to do is use the code below to make sure dates are entered in the 2 tabs Dump 1 and Dump 2.
The problem is when I put this code in with the rest of the code, after clicking ok on the msgbox, it still runs the end of the code.
How do I write it so that if ok is clicked, the rest of the code stops?
If Sheets("Dump 1").Range("C1") = "" Then MsgBox "You must enter a date in C1 on Tab Dump 1 to continue"
If Sheets("Dump 2").Range("C1") = "" Then MsgBox "You must enter a date in C1 on Tab Dump 2 to continue"
Any help will be greatly appreciated.
Thanks,
Matthew
I have quite a long piece of code with runs things like text to columns and transposing data from a master file off 2 sheets.
The code starts with Sub Refresh() and ends after all the code.
What I am trying to do is use the code below to make sure dates are entered in the 2 tabs Dump 1 and Dump 2.
The problem is when I put this code in with the rest of the code, after clicking ok on the msgbox, it still runs the end of the code.
How do I write it so that if ok is clicked, the rest of the code stops?
If Sheets("Dump 1").Range("C1") = "" Then MsgBox "You must enter a date in C1 on Tab Dump 1 to continue"
If Sheets("Dump 2").Range("C1") = "" Then MsgBox "You must enter a date in C1 on Tab Dump 2 to continue"
Any help will be greatly appreciated.
Thanks,
Matthew