Hi all,
I want my macro to select area starting from a5 and stopping to a cell covering biggest column and row value.
I have found the code below to look for the biggest cell, but I don't know how to select the area beginning from a5 ending to this biggest cell.
Private Sub FindLastCell()
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
Range("LastRow & LastColumn").Select
End If
End Sub
Hope someone can help me out with this simple question.
Best regards,
Juhanen
Bookmarks