PDA

View Full Version : How to remove the blank space which is present at the end of the value in a cell



prshnthvn
04-30-2010, 04:47 AM
Hello Everyone,

Can anyone let me know how to remove the blank space present at the end of the value in the cell?

I want this to happen for all the cell in the column and this should not affect the data in other columns.

I have attached an example in which for column B all the spaces present after th e Product name should be deleted.

Thanks in advance,
Prashanth

austenr
04-30-2010, 05:05 AM
You cant do it that I know of. The column heading is the problem. That is what is keeping the white space at the end of the data. Essentially, you can't make the column 2 different sizes.

paolo2504
04-30-2010, 06:16 AM
Use trim(cell) to elimintate leading and trialing spaces.
For example in cell D2 write formula =TRIM(B2) then autofill downwards up to D11. Then copy range D2:D11, select B2 and do pastspecial (onlyvalue).
You can do this even by VBA.

mdmackillop
04-30-2010, 08:53 AM
I you just want to make Column B narrower, wrap the text in B1 and adjust the row height to suit.

austenr
04-30-2010, 09:03 AM
Malcomb,

I think she was after leaving the heading alone and trimming the values underneath, which is not possible. Yours is the best solution. And the only one that works.

Bob Phillips
04-30-2010, 09:45 AM
Sorry guys, am I missing something here. The product names have trailing spaces, that is what is required to be removed is it not (for which paolo2504 gave a solution)?

prshnthvn
04-30-2010, 12:17 PM
Thanks guys,

"Trim" is what i wanted.

Regards
Prashanth

mdmackillop
04-30-2010, 01:29 PM
I only ckecked B11 which had no extra spaces!:(

GTO
04-30-2010, 01:46 PM
:sleuth: ..."Ahhh, I wonder if this filename is a clue. Watson, look up the Latin for Delete spaces..."

:goofball:

( a friendly tease of course)

Bob Phillips
04-30-2010, 03:27 PM
I only ckecked B11 which had no extra spaces!:(

LOL! Sod's Law.

prshnthvn
04-30-2010, 11:42 PM
:sleuth: ..."Ahhh, I wonder if this filename is a clue. Watson, look up the Latin for Delete spaces..."

:goofball:

( a friendly tease of course)
I am sorry Sherlock holmes :content:, next time i will explain my requirements much more clearly.

mdmackillop
05-01-2010, 12:12 AM
:sleuth: ..."Ahhh, I wonder if this filename is a clue. Watson, look up the Latin for Delete spaces..."

:goofball:

( a friendly tease of course).

That was meant for me!

GTO
05-01-2010, 12:28 AM
Dear prshnthvn,

My apologies if you took any offense, but indeed, that was meant for the good Mr. MacKillop; just an affectionate jab.

I must say, I learn here even when just engaging in jest. Murphy's law would be the common expression here, but they are not exactly the same!

Murphy's Law
http://en.wikipedia.org/wiki/Sods_law
Sod's Law
http://en.wikipedia.org/wiki/Sod%27s_law

Bob Phillips
05-01-2010, 02:05 AM
I must say, I learn here even when just engaging in jest.

That is what makes VBAX the best site around, you learn more than just Excel :)

prshnthvn
05-02-2010, 09:59 AM
Dear prshnthvn,

My apologies if you took any offense, but indeed, that was meant for the good Mr. MacKillop; just an affectionate jab.

I must say, I learn here even when just engaging in jest. Murphy's law would be the common expression here, but they are not exactly the same!

Murphy's Law
http://en.wikipedia.org/wiki/Sods_law
Sod's Law
http://en.wikipedia.org/wiki/Sod%27s_law

Dear GTO,
No offense taken. Actually if you see this thread, many of them have mis-understood my question in the beginning, thats why i thought that you are telling that to me. And i did not understand the joke at the first and i actually translated "delete spaces" in to latin which is "delete tractus" which made no sense and after carefully reading your comment once again i understood you are talking to sherlock holmes watson. Its a good joke.