Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
When using the first code, the code output the results required. however, when I want to make the code dynamic to find the last row, the output is (0) zero. Can someone explain what I'm doing wrong and offer a solution.
Thank you kindly
Find last row....
Thank you kindly
Code:
Dim i As Long
LRow = Range("A" & Rows.Count).End(xlUp).Row
With ActiveSheet
For i = 16 To .Range("T" & Rows.Count).End(xlUp).Row
.Range("S" & i) = WorksheetFunction.CountIf(.[B][COLOR=#ff0000]Range("A16:A346"[/COLOR][/B]), Range("T" & i))
Next i
End With
Find last row....
Code:
Dim i As LongDim LRow As Long
LRow = Range("A" & Rows.Count).End(xlUp).Row
With ActiveSheet
For i = 16 To .Range("T" & Rows.Count).End(xlUp).Row
.Range("S" & i) = WorksheetFunction.CountIf(.[COLOR=#ff0000][B]Range("A16" & LRow[/B][/COLOR]), Range("T" & i))
Next i
End With