• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

macro to undo spaces throughout the table

claudia80

Member
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
 
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
 
Back
Top