Thread: Trim Blanks
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_17_] Patrick Molloy[_17_] is offline
external usenet poster
 
Posts: 2
Default Trim Blanks

you could just wrap the result in a trim function

It depends on how your data look...but an example:
Suppose A2:A1000 contain text from a query that has
leading and trailing spaces
for thisrow = 2 to 1000
cells(Thsisrow,"A").Value = _
TRIM(cells(thisrow,"A").Value
next

HTH
Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hey guys I have an Excel assistant that has a function

to
trim blanks. I use this Trim Blanks function allot as I
am working with data from querys. THe problem is that I
have to do it manually. If I record a macro and then

use
the Trim Blanks function, the macro does not capture the
code. For this reason I have to do it manually. Is

there
a code that will do this?


Thank you

Todd Huttenstine
.