Rowland Hamilton
Active Member
- Joined
- Nov 13, 2009
- Messages
- 250
Folks:
How can I find last row using application.match and an if statement in case it doesn't match?
My boss doesn't want me to use UsedRange or xlUP.
Here is my code I can't get to work:
FYI: I know these work, but can't use them:
Thanks - Rowland
How can I find last row using application.match and an if statement in case it doesn't match?
My boss doesn't want me to use UsedRange or xlUP.
Here is my code I can't get to work:
Code:
Sub test2()
Dim iRowFinal As Integer
'shtSummary.Activate
If Not IsError(ShtSumary.Application.Match("Overall Results", Columns(11), 0).Row) Then
iRowFinal = ShtSumary.Application.Match("Overall Results", Columns(11), 0).Row
End If
Stop
End Sub
FYI: I know these work, but can't use them:
Code:
Dim iRowFinal As Integer
Dim LastRowF As Integer
Dim LastRowSC As Integer
Dim LastRowUR As Integer
LastRowUR = ActiveSheet.UsedRange.Rows.Count
LastRowF = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
iRowFinal = Range("A" & Rows.Count).End(xlUp).Row
LastRowSC = Cells.SpecialCells(xlCellTypeLastCell).Row
Thanks - Rowland