Hi All,
Currently I have the following code which works great at subtotaling column"D
" in my sheet:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lRow As Long, WF As WorksheetFunction
Set WF = Application.WorksheetFunction
If Not Application.Intersect(Target, Range("D
")) Is Nothing Then
With Sheet5
lRow = .[A1].CurrentRegion.Rows.Count + 1
.Cells(lRow, 1) = Now
.Cells(lRow, 2) = WF.Subtotal(9, Sheet4.Range("D
"))
End With
End If
Set WF = Nothing
End Sub
Another question for y'all. this code works perfect, but how do I only subtotal column "d:d" based on criteria in column "AF". For example I want to subtotal "D
" but only for the rows where column "AF" has <>"*JAPAN*"?
thanks
Currently I have the following code which works great at subtotaling column"D
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lRow As Long, WF As WorksheetFunction
Set WF = Application.WorksheetFunction
If Not Application.Intersect(Target, Range("D
With Sheet5
lRow = .[A1].CurrentRegion.Rows.Count + 1
.Cells(lRow, 1) = Now
.Cells(lRow, 2) = WF.Subtotal(9, Sheet4.Range("D
End With
End If
Set WF = Nothing
End Sub
Another question for y'all. this code works perfect, but how do I only subtotal column "d:d" based on criteria in column "AF". For example I want to subtotal "D
thanks