automatic replacing of a VBE sub in all open workbooks

  • Thread starter Thread starter pls123
  • Start date Start date
P

pls123

hi all !
i know how to make automatic replacing of a cell for all open workbooks..

now i neeed to replace a sub with another 1 with a little difference..

is there a way to make it ?
tx !
 
You can write another Sub procedure and call it from a third procedure based
on conditions:

Sub master()
If Range("A1") <> "Condition" Then
Macro1
Else
Macro2
End If
End Sub

Sub Macro1()
MsgBox "Macro1"
Range("A1") = "Condition")
End Sub

Sub Macro2
MsgBox "Macro2"
Range("1").ClearContents
End Sub
 
tx for help !


JLGWhiz said:
You can write another Sub procedure and call it from a third procedure based
on conditions:

Sub master()
If Range("A1") <> "Condition" Then
Macro1
Else
Macro2
End If
End Sub

Sub Macro1()
MsgBox "Macro1"
Range("A1") = "Condition")
End Sub

Sub Macro2
MsgBox "Macro2"
Range("1").ClearContents
End Sub





.
 
Back
Top