Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Trim Cells
How do I perform a trim function on a range of cells using VBA. Ultimately,
I would like to select all cells in a column and perform the trim function. |
#2
|
|||
|
|||
Trim Cells
Try something like the following:
Dim Rng As Range For Each Rng In Application.Intersect(ActiveCell.EntireColumn, _ ActiveSheet.UsedRange.SpecialCells(xlTextValues)). Cells Rng.Value = Application.Trim(Rng.Text) Next Rng -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "aftamath" wrote in message ... How do I perform a trim function on a range of cells using VBA. Ultimately, I would like to select all cells in a column and perform the trim function. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do you "select locked cells" w/o "select unlocked cells"? | Excel Discussion (Misc queries) | |||
Deselect Cells while using ctrl | Excel Discussion (Misc queries) | |||
Counting only active cells | Excel Discussion (Misc queries) | |||
Help adding text values | Excel Worksheet Functions | |||
Convert data type of cells to Text,Number,Date and Time | Excel Worksheet Functions |