Macro to run or not run a second Macro

D

Darin Kramer

Howdie!

I need to run a macro that, depending on the result in a cell, runs
another Macro (second macro is just a hide of a column)

So for example, when the user runs Macro 1 it needs to check the value
in Cell A1. If A1 = Yes, then run Macro number 2. If the value in a1 =
No, then dont run any Macros and the first macro can be stopped.

Any ideas?

Thanks and Regards

Darin
 
R

Ron de Bruin

Hi Darin

Use this

Sub macro1()
If Sheets("sheet1").Range("A1").Value = "Yes" Then
macroname
End If
End Sub

Sub macroname()
MsgBox "H1"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top