View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Removing preceeding spaces

from vba help for trim
LTrim, RTrim, and Trim Functions
Returns a Variant (String) containing a copy of a specified string without
leading spaces (LTrim), trailing spaces (RTrim), or both leading and
trailing spaces (Trim).

Syntax

LTrim(string)

RTrim(string)

Trim(string)

The required string argument is any valid string expression. If string
contains Null, Null is returned.


--
Don Guillett
SalesAid Software

"wjd01" wrote in message
...
When opening specific text documents in excel, the text is
captured with 6 or 7 preceeding spaces (this is
expected). I'm looking for a macro that will remove only
the preceeding spaces, but not touch any spaces that
appear after the first character of text. Is there a
macro that can remove these? I have tried to setup a
macro that copies and pastes values...etc. but to no
avail. The spaces are always carried along.

Thanks for your suggestions.

wjd01