Sooner4Life
New Member
- Joined
- Mar 12, 2014
- Messages
- 16
I have an excel sheet setup to track quarterly taxes owed. I currently use VBA code to date stamp one column when another is not blank and that works fine but I would like to change it to the code below. The only problem is all the ranges listed have formulas "=IFERROR(IF(SUM(D4:E4)>0,IF(D4<>"",(D4*$AC$25))+IF(E4<>"",(E4*$AC$26)),""),"")" so the date stamp never triggers . Any help would be appreciated.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
ActiveSheet.Unprotect
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("F4:F104,L4:L104,R4:R104,X4:X104"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, -4).ClearContents
Else
With .Offset(0, -4)
.NumberFormat = "mm/dd/yyyy"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
With ActiveSheet
.Protect AllowFiltering:=True
If Target.Cells.Count > 1 Then
Exit Sub
End If
End With
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
ActiveSheet.Unprotect
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("F4:F104,L4:L104,R4:R104,X4:X104"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, -4).ClearContents
Else
With .Offset(0, -4)
.NumberFormat = "mm/dd/yyyy"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
With ActiveSheet
.Protect AllowFiltering:=True
If Target.Cells.Count > 1 Then
Exit Sub
End If
End With