In cell HM3 i have Gary's countdown formula modified to my needs -
=IF(LEFT(GW4)<>"-",(HOUR(GW4)*3600)+(MINUTE(GW4)*60)+SECOND(GW4),-((HOUR(SUBSTITUTE(GW4,"-",""))*3600)+(MINUTE(SUBSTITUTE(GW4,"-",""))*60)+SECOND(SUBSTITUTE(GW4,"-",""))))
& the following worksheet change code -
- Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$HM$3" Then Exit Sub
Application.EnableEvents = False
With ThisWorkbook.Sheets(Target.Worksheet.Name)
If .Range("$HM$3") < 5 Then
Range("HJ7:HR30").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("HL5").Select
End If
End With
Application.EnableEvents = True
End Sub
now nothing happens when the value in HM3 counts down to less than 5 seconds, but if i manually type a number less than 5 into the cell then the copy/paste action takes place.
any ideas why the code wont run? many thanks if anyone can help.