Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("m3:n3,m6")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
tos = Range("m3").Value
Range("y3:ab3").ClearContents
If tos = "Type 1" Then Range("z3").Value = ">0"
If tos = "Type 2" Then Range("aa3").Value = ">0"
If tos = "Type 3" Then Range("ab3").Value = ">0"
If tos = "Type 4" Then Range("ac3").Value = ">0"
Call lookup
'MsgBox "Cell " & Target.Address & " has changed."
End If
End Sub
The above VBA code runs when i change cells Set KeyCells = Range("m3:n3,m6"). and calls macro lookup
which is good but i want to also run another macro when cell bp6 is changed and calls another macro lookupmat
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("m3:n3,m6")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
tos = Range("m3").Value
Range("y3:ab3").ClearContents
If tos = "Type 1" Then Range("z3").Value = ">0"
If tos = "Type 2" Then Range("aa3").Value = ">0"
If tos = "Type 3" Then Range("ab3").Value = ">0"
If tos = "Type 4" Then Range("ac3").Value = ">0"
Call lookup
'MsgBox "Cell " & Target.Address & " has changed."
End If
End Sub
The above VBA code runs when i change cells Set KeyCells = Range("m3:n3,m6"). and calls macro lookup
which is good but i want to also run another macro when cell bp6 is changed and calls another macro lookupmat