Sub RemoveLeadingSpace() 'Updateby20131129 Dim Rng As Range Dim WorkRng As Range On Error Resume Next xTitleId = "KutoolsforExcel" 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 |
Source: https://www.extendoffice.com/documents/excel/667-excel-remove-first-space.html