Friends,
I have a column of data in my spreadsheet that has extra spaces after the
data in each cell. For example, rather than having "DELL" it has "DELL ".
What is the function to get rid of the extra spaces?
Thanks,
Alan
--
achidsey
Friends,
I have a column of data in my spreadsheet that has extra spaces after the
data in each cell. For example, rather than having "DELL" it has "DELL ".
What is the function to get rid of the extra spaces?
Thanks,
Alan
--
achidsey
Trim() will delete all trailing spaces.
=Trim(A1)
Where A1 contains the word "Dell "
In code it would look like this
sheet1.range("A1").value = trim(sheet1.range("A1").value)
--
HTH...
Jim Thomlinson
"achidsey" wrote:
>
> Friends,
>
> I have a column of data in my spreadsheet that has extra spaces after the
> data in each cell. For example, rather than having "DELL" it has "DELL ".
>
> What is the function to get rid of the extra spaces?
>
> Thanks,
>
> Alan
>
>
>
> --
> achidsey
J and Jim,
Thanks for your assistance
Alan
--
achidsey
"achidsey" wrote:
>
> Friends,
>
> I have a column of data in my spreadsheet that has extra spaces after the
> data in each cell. For example, rather than having "DELL" it has "DELL ".
>
> What is the function to get rid of the extra spaces?
>
> Thanks,
>
> Alan
>
>
>
> --
> achidsey
Its probably a trivial point in this case, but there are three types of trim
in VBA: From the help:
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).
--
regards,
Tom Ogilvy
"achidsey" <[email protected](notmorespam)> wrote in message
news:[email protected]...
>
> J and Jim,
>
> Thanks for your assistance
>
> Alan
>
>
> --
> achidsey
>
>
> "achidsey" wrote:
>
> >
> > Friends,
> >
> > I have a column of data in my spreadsheet that has extra spaces after
the
> > data in each cell. For example, rather than having "DELL" it has "DELL
".
> >
> > What is the function to get rid of the extra spaces?
> >
> > Thanks,
> >
> > Alan
> >
> >
> >
> > --
> > achidsey
And just to add to Tom's trivial point, an even more trivial point...
If the OP wants to remove leading, trailing and multiple repeated internal
spaces, the OP could use:
application.trim()
" this is a test "
would become
"this is a test"
(quotes used just for readability.)
Tom Ogilvy wrote:
>
> Its probably a trivial point in this case, but there are three types of trim
> in VBA: From the help:
>
> 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).
>
> --
> regards,
> Tom Ogilvy
>
> "achidsey" <[email protected](notmorespam)> wrote in message
> news:[email protected]...
> >
> > J and Jim,
> >
> > Thanks for your assistance
> >
> > Alan
> >
> >
> > --
> > achidsey
> >
> >
> > "achidsey" wrote:
> >
> > >
> > > Friends,
> > >
> > > I have a column of data in my spreadsheet that has extra spaces after
> the
> > > data in each cell. For example, rather than having "DELL" it has "DELL
> ".
> > >
> > > What is the function to get rid of the extra spaces?
> > >
> > > Thanks,
> > >
> > > Alan
> > >
> > >
> > >
> > > --
> > > achidsey
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks