Automatically run a macro when a cell is changed in a worksheet

shina67

Board Regular
Joined
Sep 18, 2014
Messages
138
Hi All,

I hope someone can help.
I have a workbook with 12 worksheets in it.
I have a worksheet called 'Master LOG-Owner Geoff Clarkson'.
When a cell in column F is changed on this worksheet I need a macro to automatically run.
Thanks in advance.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
You would use the Worksheet_Change event. Set the target column = to 6
 
Upvote 0
You would use the Worksheet_Change event. Set the target column = to 6




Thanks Alan for your reply.

If I use the following code would it work?



Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 
 
 
If Target.Address = 6 Then
'
' Macro1 Macro
' unfilter
'


'
    ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets("Customer Serv-Owner Gary Mardy").Select
    ActiveSheet.Range("$A$1:$X$1624").AutoFilter Field:=6
    Sheets("Production-Owner Chris Smith").Select
    ActiveSheet.Range("$A$1:$X$1624").AutoFilter Field:=6
     Sheets("Purchasing-Owner Clive Stones").Select
    ActiveSheet.Range("$A$1:$X$1624").AutoFilter Field:=6
    Sheets("Survey-Owner Lee Ashton").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    Sheets("Install-Owner Phil Clarkson").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    Sheets("Order Process-Owner Chris Jupp").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    Sheets("After Sales-Owner Matt Hodgson").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    Sheets("Sales-Owner Jonny Watkins").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    Sheets("Trade-Owner Joe Bratt").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    Sheets("Despatch-Owner Tom McClymont").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6
    ActiveWindow.ScrollWorkbookTabs Sheets:=-1
    Sheets("Customer Serv-Owner Gary Mardy").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:= _
        "=customer", Operator:=xlAnd
    Sheets("Production-Owner Chris Smith").Select
    ActiveSheet.Range("$A$1:$X$1624").AutoFilter Field:=6, Criteria1:= _
        "=production", Operator:=xlAnd
    Sheets("Survey-Owner Lee Ashton").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:="=survey" _
        , Operator:=xlAnd
    Sheets("Install-Owner Phil Clarkson").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:= _
        "=installation", Operator:=xlAnd
    Sheets("Order Process-Owner Chris Jupp").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:= _
        "=order processing", Operator:=xlAnd
    Sheets("After Sales-Owner Matt Hodgson").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:= _
        "=after sales", Operator:=xlAnd
    Sheets("Sales-Owner Jonny Watkins").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:="=sales" _
        , Operator:=xlAnd
    Sheets("Trade-Owner Joe Bratt").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:="=trade" _
        , Operator:=xlAnd
         Sheets("Purchasing-Owner Clive Stones").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:="=Purchasing/Stock" _
        , Operator:=xlAnd
    Sheets("Despatch-Owner Tom McClymont").Select
    ActiveSheet.Range("$A$1:$L$1624").AutoFilter Field:=6, Criteria1:= _
        "=despatch", Operator:=xlAnd
    ActiveWindow.ScrollWorkbookTabs Sheets:=-1
    Sheets("Master LOG").Select

End If
 
 
 
End Sub
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,214,384
Messages
6,119,201
Members
448,874
Latest member
Lancelots

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