Yes, it would...but I wouldn't suspect that you'd want to bogg down your
system by checking of the 168,099,840 cells (minimum depending on excel
version). Find the column and row at which your data stops, and adjust your
range accordingly. You should be able to do this by pressing Ctrl+End.
Regards,
Paul
--
"Niniel" <(E-Mail Removed)> wrote in message
news:45E203D9-AEC4-481D-BA09-(E-Mail Removed)...
> Would this also work for the entire worksheet? I don't want to have to
> specify a range.
>
> "PCLIVE" wrote:
>
>> One way:
>>
>> For Each cell In Range("A1:A10")
>> cell.Value = Trim(cell.Value)
>> Next cell
>>
>>
>> Adjust your range as needed.
>>
>> You could also do this via a formula.
>>
>> With data in A1.
>> =TRIM(A1)
>> Then copy down as needed.
>> Copy entire column and Paste Special-Values only.
>>
>> HTH,
>> Paul
>>
>> --
>>
>> "Niniel" <(E-Mail Removed)> wrote in message
>> news:FD4F2159-02EC-4556-9C4C-(E-Mail Removed)...
>> > Hello,
>> >
>> > I would like to make a macro that checks a worksheet and deletes any
>> > space
>> > it finds at the end of a word in a cell, but only if it's the last
>> > word.
>> > In
>> > other words "test " is what I'd like to fix, but "test test" or "test
>> > test
>> > test" (etc) is not.
>> >
>> > How could this be accomplished?
>> >
>> > Thank you.
>> >
>> >
>>
>>
>>
|