Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub UseSpecialCells()
Dim l_sLastCellAddress As String
Dim l_lNextEmptyRow As Long
l_sLastCellAddress = Selection.SpecialCells(xlCellTypeLastCell).Address
l_lNextEmptyRow = Selection.SpecialCells(xlCellTypeLastCell).Row + 1
MsgBox "Last cell in sheet: " & l_sLastCellAddress & ". First empty row: " & l_lNextEmptyRow
End Sub
Sub UseUsedRange()
Dim l_wksTest As Worksheet
Dim l_sLastCellAddress As String
Dim l_lNextEmptyRow As Long
Set l_wksTest = ThisWorkbook.Sheets(1)
l_sLastCellAddress = l_wksTest.Cells(l_wksTest.UsedRange.Rows.Count, l_wksTest.UsedRange.Columns.Count).Address
l_lNextEmptyRow = l_wksTest.UsedRange.Rows.Count + 1
MsgBox "Last cell in sheet: " & l_sLastCellAddress & ". First empty row: " & l_lNextEmptyRow
Set l_wksTest = Nothing
End Sub