Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Sub Clean_Trim() Application.EnableCancelKey = xlDisabled '// CLEAN > Removes all nonprintable characters from text. '// TRIM > Removes all spaces from text except for single Dim CleanTrimRg As Range Dim oCell As Range Dim Func As WorksheetFunction Set Func = Application.WorksheetFunction On Error Resume Next If Err Then MsgBox "No data to clean and Trim!": Exit Sub For Each oCell In Excel.Selection With oCell If .HasFormula = False Then oCell = Func.Clean(Func.Trim(oCell)) End If End With Next End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|I need a User Form to Input Data appear when a cell is clicked on||34||42|
|comparsion of two excel and get the result in another sheet using macro/VBA||3||54|
|VBA to Update status Column based on recent date||20||41|
|loading data from a spreadsheet into an array or equivalent and retrieving data using key value||7||22|