Dear Experts
Please help!!!
I need to auto call macro without pressing button.
example If user enters time in cell range("M4:M200")
P4:P200 (=IF(M4="","",1)
If P4:P200 "1" Call add_timepunch (macro)
I have this below code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$1" Then
Set JR = Sheets("Jobs Record")
Set DTE = Sheets("DailyTaskEntry")
Set TP = Sheets("TimePunch")
'Clear Current Data
Call Clearit
'See If Date is in Jobs record
Dim JobFound As Range
Set JR = Sheets("Jobs Record")
D = Target.Value
Set JobFound = JR.Columns(1).Find(Target.Value)
If Not JobFound Is Nothing Then
'If it is in the jobs record then retrieve existing data
Call Retrieve(D)
'If it is in the jobs record then retrieve existing data
Call RetrieveTimePunch(D)
'Brings save changes button to front
ActiveSheet.Shapes("Button 3").ZOrder msoBringToFront
Else
'Brings Add button to front
Call Clearit
ActiveSheet.Shapes("Button 1").ZOrder msoBringToFront
End If
End If
If Target.Column = 3 And Target.Row >= 4 And Target.Row <= 200 Then
Call Colourc
End If
' NOT WORKING
If Not Application.Intersect(Target, Range("P4:P200")) Is Nothing Then
Call add_timepunch
End If
End Sub
Bookmarks