Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I apply LTRIM to entire Sheet?
Hey guys-
I have an entire sheet filled with data. Many columns/rows have spaces at the beginning of the cell. Many cells have multiple words in them, so a simple Find/Replace wont work. I need to use LTRIM across the entire worksheet so it deletes out all the leading spaces. How can this be done easily??? Thanks D |
#2
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I apply LTRIM to entire Sheet?
Hi "D",
You would need a macro. Posting to anyone of these groups gets read by the same people. But at least we know you know about macros (programming). There is an LTRIM in VBA so you can use the VBA function. For rest of macro see http://www.mvps.org/dmcritchie/excel/join.htm#trimall you would want to give it a different name like LtrimAll --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "D" wrote in message news:3NfSc.26637$Oi.2989@fed1read04... Hey guys- I have an entire sheet filled with data. Many columns/rows have spaces at the beginning of the cell. Many cells have multiple words in them, so a simple Find/Replace wont work. I need to use LTRIM across the entire worksheet so it deletes out all the leading spaces. How can this be done easily??? Thanks D |
#3
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I apply LTRIM to entire Sheet?
Hi,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sub TEST() Dim CL As Range Dim RNG As Range Application.ScreenUpdating = False Application.Calculation = xlCalculationManual On Error Resume Next Set RNG = Cells.SpecialCells(xlConstants, xlTextValues) For Each CL In Intersect(Selection, RNG) CL.Value = LTrim(CL.Value) Next On Error GoTo 0 Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Regards, Soo Cheon Jheong _ _ ^ąŻ^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to apply macros to entire workbook | Excel Discussion (Misc queries) | |||
How to apply the same formula to an entire column | New Users to Excel | |||
HOW DO I APPLY A FORMULA FOR AND ENTIRE ROW? | Excel Worksheet Functions | |||
How do I apply a function to an entire column? | New Users to Excel | |||
I would like to apply the same calculation to an entire row | Excel Worksheet Functions |