Run a Macro based on cell contents

Odie

Board Regular
Joined
Oct 23, 2009
Messages
90
Within my “Macro A” I want to run one of 2 other macros based on the cell contents of M11.
If M11 is visibly blank : Run “Macro 1”
If M11 shows “SEALS” : Run “Macro 2”.
<o:p></o:p>
(M11 contains formula referring to cell in another sheet.
Visibly M11 will either be blank or show the word “SEALS”.)
<o:p></o:p>
Can this be done and how. Thanks Odie. Excel 2003.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
change macro name as per your macro name
Rich (BB code):
Sub Test()
If Range("M11") = "" Then
Call Macro 1
ElseIf Range("M11") = "SEALS" Then
Call Macro 2
End If
End Sub
 
Upvote 0
Thanks that worked great, just what I asked for.
However what would that look like instead of "SEALS" it would run Macro 2 IF cell M11 was occupied with any number?
Thanks Odie
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,185
Members
448,872
Latest member
lcaw

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