Home |
Search |
Today's Posts |
#1
|
|||
|
|||
TrimTextRange
Hi Guys
I have a Trim text code, but how do I change it to trim only the range selected? Sub TrimTextRange() Application.ScreenUpdating = False Dim cell As Range, areaToTrim As Range Set areaToTrim = Sheet1.Range("A1:H1000") For Each cell In areaToTrim cell.Value = Trim(cell.Value) Next cell End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|