Need to add Message Box in VBA to force two Macros to be Run in Order

Flapjack

Board Regular
Joined
Aug 24, 2005
Messages
61
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet that has two macros in it. It is important that macro #1 is run before macro #2. People may not follow instructions, so I want a message box to pop up if they first try to run macro #2, and tell them to run macro #1 first and then exit out of that macro. When someone does run macro #1, it populates cell A4 with a letter, so I'm thinking that at the start of macro #2 it checks for a value in A4. If there is a value, then continue running macro #2. If no value, then the message box pops up with the warning and an OK button to exit back to the spreadsheet.

My VBA skills are badly rusty and I'm doing this as a favor to someone and it has some time constraints getting this project done. I appreciate any help!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
It would be something like:

Code:
If Len(Sheets("sheet name").Range("A4").Value) = 0 then
    msgbox "You must run macro 1 first!
   Exit Sub
End If
 
Upvote 0
Solution

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top