ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Spaces in cells (https://www.excelbanter.com/excel-worksheet-functions/102613-spaces-cells.html)

Brian

Spaces in cells
 
When I copy and paste information from a website to excel - the data that I
have copied from the website was center justified so spaces are copied. One
of the columns of data is currency so the $12.50 has three spaces before the
$. I cannot apply any formatting to the cells with the spaces in there.
When I delete the spaces everything is fine and my colums total correctly.
I want to remove all leading spaces form all cells in the worksheet.



Biff

Spaces in cells
 
See this:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

If you're copy/pasting from the web those spaces may not be standard char 32
spaces. They may be char 160 spaces.

The macro at the above link will take care of both. If you copy/paste alot
from the web this macro is a real time saver. I have it attached to a button
and is on one of my toolbars.

Biff

"Brian" wrote in message
...
When I copy and paste information from a website to excel - the data that
I have copied from the website was center justified so spaces are copied.
One of the columns of data is currency so the $12.50 has three spaces
before the $. I cannot apply any formatting to the cells with the spaces
in there. When I delete the spaces everything is fine and my colums total
correctly. I want to remove all leading spaces form all cells in the
worksheet.





All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com