Run Macro 1 automatically from cell change and another macro from another cell in same sheet

rastak

New Member
Joined
Dec 16, 2012
Messages
7
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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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