Using the End Property to Navigate within a Worksheet
Sub ExperimentWithEnd()
Dim ws As Worksheet
Dim rg As Range
Set ws = ThisWorkbook.Worksheets(1)
Set rg = ws.Cells(1, 1)
ws.Cells(1, 8).Value = "rg.address = " & rg.Address
ws.Cells(2, 8).Value = "rg.End(xlDown).Address = " & rg.End(xlDown).Address
ws.Cells(3, 8).Value = "rg.End(xlDown).End(xlDown).Address = " & rg.End(xlDown).End(xlDown).Address
ws.Cells(4, 8).Value = "rg.End(xlToRight).Address = " & rg.End(xlToRight).Address
Set rg = Nothing
Set ws = Nothing
End Sub
Related examples in the same category