Afternoon All,
I am trying to locate the a variation of the last cell used in a spreadsheet.
Each time I create a new series it goes into the next available column. So what I am trying to locate each time is the first available cell in the last used column.
I have this code so far (taken from Daves concepts on Ozgrid):
Sub LastCell()
Dim LastColumn As Integer
Dim LastRow As Long
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
End If
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
LastRow = Cells.Find(What:="*", After:=Cells(1, LastColumn), _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
End If
Cells(LastRow, LastColumn).Offset(1, 0).Select
End Sub
Is there a more efficient way of doing this?
Regards
Weasel