Hi
Description of Problem:
Copied and pasted an internet webpage table into a worksheet. (There are going to be multiple workbooks, with multiple worksheets, each worksheet containing one table that has been pasted.) All cells have what appears to be a space before the beginning of the value, whether numeric or text. I am trying to find a better way to remove these spaces rather than individually going thru each cell and deleting these leading spaces. These spaces have to be removed from the numeric values otherwise summing them (from a column) into a cell, at the bottom, doesn't work.
Solutions Attempted:
1) Used Trim function in following manner. A1:D100 were the cells I wished to trim. In cell E1 put =TRIM(A1) in it. Then copied cell E1 and then selected cells E1:H100. Right-click and pasted. I had now trimmed all of the columns. Then I selected E1:H100 and did copy. Then selected A1:D100 and did paste special, and selected Values. Problem was the spaces weren't gone.
2) Tried Clean instead, just like above, and unfortunately, with the same lack of results.
3) I assumed at this point the blank was char 160, so I used the following function in cell E1 to get rid of the character: =SUBSTITUTE(A1,CHAR(160),"")
The message, "No Ref" was displayed in the cell.
So now I am at a loss at what to do. For those of you who would suggest a VBA solution, I wouldn't mind using VBA, but not sure what to do once a function has been placed in a standard module. i.e. If I use/put the function in a cell on the same worksheet, will it then automatically run the function and format the sheet. Any help would be greatly appreciated. Thanks
Description of Problem:
Copied and pasted an internet webpage table into a worksheet. (There are going to be multiple workbooks, with multiple worksheets, each worksheet containing one table that has been pasted.) All cells have what appears to be a space before the beginning of the value, whether numeric or text. I am trying to find a better way to remove these spaces rather than individually going thru each cell and deleting these leading spaces. These spaces have to be removed from the numeric values otherwise summing them (from a column) into a cell, at the bottom, doesn't work.
Solutions Attempted:
1) Used Trim function in following manner. A1:D100 were the cells I wished to trim. In cell E1 put =TRIM(A1) in it. Then copied cell E1 and then selected cells E1:H100. Right-click and pasted. I had now trimmed all of the columns. Then I selected E1:H100 and did copy. Then selected A1:D100 and did paste special, and selected Values. Problem was the spaces weren't gone.
2) Tried Clean instead, just like above, and unfortunately, with the same lack of results.
3) I assumed at this point the blank was char 160, so I used the following function in cell E1 to get rid of the character: =SUBSTITUTE(A1,CHAR(160),"")
The message, "No Ref" was displayed in the cell.
So now I am at a loss at what to do. For those of you who would suggest a VBA solution, I wouldn't mind using VBA, but not sure what to do once a function has been placed in a standard module. i.e. If I use/put the function in a cell on the same worksheet, will it then automatically run the function and format the sheet. Any help would be greatly appreciated. Thanks