Want to copy COUNTIF Formula in a Column with Dynamic Row length
Unable to have the reference to Criteria dynamic, G4 in this case (highlighted in red,bold below).
When it's copied to next row it continues to stay as G4
Dim lr As Long
Dim strAd As String
Dim strFm As String
With ActiveSheet
lr = .Cells(.Rows.Count, "G").End(xlUp).Row
strAd = .Range("E4", .Cells(lr, 5)).Address(0, 0)
strFm = "=COUNTIF(" & strAd & ", G4 )"
End With
Unable to have the reference to Criteria dynamic, G4 in this case (highlighted in red,bold below).
When it's copied to next row it continues to stay as G4
Dim lr As Long
Dim strAd As String
Dim strFm As String
With ActiveSheet
lr = .Cells(.Rows.Count, "G").End(xlUp).Row
strAd = .Range("E4", .Cells(lr, 5)).Address(0, 0)
strFm = "=COUNTIF(" & strAd & ", G4 )"
End With