Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created June 12, 2017 07:31
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/03604ccc0730ea00674895069e68006e to your computer and use it in GitHub Desktop.
Save ndthanh/03604ccc0730ea00674895069e68006e to your computer and use it in GitHub Desktop.
Sub RemoveLeadingSpace()
'Updateby20131129
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "Hoc Excel Online"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
Rng.Value = VBA.LTrim(Rng.Value)
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment