C claudia80 Member Nov 1, 2023 #1 macro to undo spaces throughout the table Good morning. Could you help me create the code to select the excel file and apply the formula cancel preceding and trailing spaces from all the columns of the table present in the excel file? Thank you
macro to undo spaces throughout the table Good morning. Could you help me create the code to select the excel file and apply the formula cancel preceding and trailing spaces from all the columns of the table present in the excel file? Thank you
Belleke Well-Known Member Nov 1, 2023 #2 Try Code: Sub TrimExample1() Dim Rng As Range Set Rng = Sheets("Sheet1").ListObjects(1).Range For Each Cell In Rng Cell.Value = Trim(Cell) Next Cell End Sub
Try Code: Sub TrimExample1() Dim Rng As Range Set Rng = Sheets("Sheet1").ListObjects(1).Range For Each Cell In Rng Cell.Value = Trim(Cell) Next Cell End Sub
Marc L Excel Ninja Nov 1, 2023 #3 Without looping the Excel function TRIM can be directly applied …