Removing spaces in cell

T

Tom

Hello,

When importing external data into excel, I end up with 2 blank spaces
before the data. Need to remove the 2 blanks spaces for all the cells
in that column. Changed the format and tried decreasing indent,
neither worked.

Is there a formula or VBA code that would work?

Thanks,
Tom
 
R

Roger Govier

Hi Tom

If you are sure it is always 2 spaces, then in another column enter
=MID(A1,3,255)
and copy down
When finished copy your new column and Paste Special>Values back over
the original data to "fix the data".
The helper column can then be deleted.

Alternatively, if the data doesn't have other spaces within the source
cells you could use
=SUBSTITUTE(A1," ","")
and repeat as above.
 
T

Tom

Got it working with the macro. Tried the =MID(A1,3,255) but didn't
work for me as needed.

Thanks to all,
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top