Hi everyone,
I would love to have a macro to remove space from cells. I tried TRIM function but its removing extra spaces only & not remove trailing space at the end of the string.
Thanks for your help in advance!
Regards,
Vikas
Hi everyone,
I would love to have a macro to remove space from cells. I tried TRIM function but its removing extra spaces only & not remove trailing space at the end of the string.
Thanks for your help in advance!
Regards,
Vikas
=substitute(a1,char(160),"") will do it...
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.
Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh
To trim all cells on a sheet incl char 160, try:
Best,Please Login or Register to view this content.
berlan
and with formula, alternatively:
=trim(substitute(a1,char(160)," "))
Also by code, either:
or,Please Login or Register to view this content.
where the second replaces the char 160 with a spacePlease Login or Register to view this content.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks