Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default 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   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 691
Default 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   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 46
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to apply macros to entire workbook Sherry Excel Discussion (Misc queries) 2 January 16th 08 05:23 AM
How to apply the same formula to an entire column Lisab New Users to Excel 5 August 9th 07 04:34 PM
HOW DO I APPLY A FORMULA FOR AND ENTIRE ROW? jcpayne Excel Worksheet Functions 2 July 19th 06 06:02 PM
How do I apply a function to an entire column? didja New Users to Excel 1 November 23rd 05 05:04 AM
I would like to apply the same calculation to an entire row mnirula Excel Worksheet Functions 3 April 25th 05 10:05 PM


All times are GMT +1. The time now is 11:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"