Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created December 22, 2016 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndthanh/d9279f9c2f9550b196cf488f8b2fe193 to your computer and use it in GitHub Desktop.
Save ndthanh/d9279f9c2f9550b196cf488f8b2fe193 to your computer and use it in GitHub Desktop.
Sub LastColumnInOneRow()
'Find the last used column in a Row: row 1 in this example
Dim LastCol As Integer
With ActiveSheet
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
MsgBox LastCol
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment