Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set areaToTrim = Selection
HTH. Best wishes Harald "MrPetreli" wrote in message ... Hi Guys I have a Trim text code, but how do I change it to trim only the rang 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 Su -- MrPetreli |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Open excel file when file name is entered in cell | Excel Programming | |||
Excel '00, 1st file has macros, how to stop macro in 2nd file? | Excel Discussion (Misc queries) | |||
how can i call macro in powerpoint file from excel file | Excel Programming | |||
Macro to save Excel file with date and time in the file name? | Excel Programming | |||
VBA Macro to copy an column from one Excel file into another file | Excel Programming |