Hi, this is almost what i need. But if i have three macro at the end of your
macro, it's not running the first or the second macro but the third.
Can't this macro have my code in the middle of yours?
Ex:
Sub Macro1()
Set sht = Sheets("Sheet1") ' change to suit
With sht
If UCase(.Range("A1")) = "JOHN" _
And UCase(.Range("C1")) = "MARI" _
And .Range("D1") = "" Then
msg = MsgBox("Macro 1", vbInformation, "Running")
'my macro 1
Range("A1:C15").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("A1").Select
'end of my macro 1
ElseIf UCase(.Range("A1")) = "JIM" _
And UCase(.Range("C1")) = "CRIS" _
And UCase(.Range("D1")) = "MONDAY" Then
msg = MsgBox("Macro 2", vbInformation, "Running")
Macro2
Else
MsgBox "Criteria not met"
Exit Sub
End If
'my macro 2
Range("A1:C15").Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Range("A1").Select
End With
'end of my macro 2
End Sub
Can this be done to avoid the third macro?
Thanks!
"Per Jessen" a scris: