[color="Blue"]
Below are three methods that will find the "LastRow", "LastColumn" and the "LastCell"
Find the last used Row on a Worksheet: [/color]
[b]Sub FindLastRow()[/b]
Dim LastRow As Long
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
MsgBox LastRow
End If
[b]End Sub[/b][color="Blue"]
--------------------------------------------------------------------------------
Find the last used Column on a Worksheet: [/color]
[b]Sub FindLastColumn()[/b]
Dim LastColumn As Integer
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Columns.
LastColumn = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
MsgBox LastColumn
End If
[b]End Sub[/b][color="Blue"]
--------------------------------------------------------------------------------
Find the last used Cell on a Worksheet: [/color]
[b]Sub FindLastCell()[/b]
Dim LastColumn As Integer
Dim LastRow As Long
Dim LastCell As Range
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
LastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
'Search for any entry, by searching backwards by Columns.
LastColumn = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
MsgBox Cells(LastRow, LastColumn).Address
End If
[b]End Sub[/b]