Skip to content

Instantly share code, notes, and snippets.

@GabrielMMelo
Created July 17, 2020 16:16
Show Gist options
  • Save GabrielMMelo/381125479e6a5de9df4d07297ca940c0 to your computer and use it in GitHub Desktop.
Save GabrielMMelo/381125479e6a5de9df4d07297ca940c0 to your computer and use it in GitHub Desktop.
Reliable way to get last used cell in Excel using vba
Dim rLastCell As Range
Set rLastCell = ws.Cells.Find(What:="*", After:=ws.Cells(1, 1), LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious, MatchCase:=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment