ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting (https://www.excelbanter.com/excel-programming/393016-deleting.html)

bodhisatvaofboogie

Deleting
 
I have some extra spaces that pop up when copying data from a webpage.

Example:

123,123 comes into Excel as
123,123 with a space at the beginning and the end.

I am doing some calculations with these cells in a macro, and of course the
formula won't calculate until i delete the space at the beginning and the
end. What would be a good way to get rid of those spaces? There are many
cells, so a nice formula would be great, I can slip it into the macro and go
about my merry way.

Text to columns isn't seeming to work, The length of the data in the cells
varies from 2 numbers to a 8 numbers. Any advice will be useful, THANKS!!!



[email protected]

Deleting
 
On Jul 10, 9:20 am, bodhisatvaofboogie
wrote:
I have some extra spaces that pop up when copying data from a webpage.

Example:

123,123 comes into Excel as
123,123 with a space at the beginning and the end.

I am doing some calculations with these cells in a macro, and of course the
formula won't calculate until i delete the space at the beginning and the
end. What would be a good way to get rid of those spaces? There are many
cells, so a nice formula would be great, I can slip it into the macro and go
about my merry way.

Text to columns isn't seeming to work, The length of the data in the cells
varies from 2 numbers to a 8 numbers. Any advice will be useful, THANKS!!!


try
=TRIM(text)



bodhisatvaofboogie

Deleting
 
I'm not sure I'm getting how to utilize that in a macro. With the cell
selected do: ???

Thanks for the help!

" wrote:

On Jul 10, 9:20 am, bodhisatvaofboogie
wrote:
I have some extra spaces that pop up when copying data from a webpage.

Example:

123,123 comes into Excel as
123,123 with a space at the beginning and the end.

I am doing some calculations with these cells in a macro, and of course the
formula won't calculate until i delete the space at the beginning and the
end. What would be a good way to get rid of those spaces? There are many
cells, so a nice formula would be great, I can slip it into the macro and go
about my merry way.

Text to columns isn't seeming to work, The length of the data in the cells
varies from 2 numbers to a 8 numbers. Any advice will be useful, THANKS!!!


try
=TRIM(text)




bodhisatvaofboogie

Deleting
 
Dim MyString, TrimString
MyString = ActiveCell
TrimString = Trim(MyString)

This is what i'm trying, and it's just not working. Doesn't seem to come up
with any errors, just does nothing.



" wrote:

On Jul 10, 9:20 am, bodhisatvaofboogie
wrote:
I have some extra spaces that pop up when copying data from a webpage.

Example:

123,123 comes into Excel as
123,123 with a space at the beginning and the end.

I am doing some calculations with these cells in a macro, and of course the
formula won't calculate until i delete the space at the beginning and the
end. What would be a good way to get rid of those spaces? There are many
cells, so a nice formula would be great, I can slip it into the macro and go
about my merry way.

Text to columns isn't seeming to work, The length of the data in the cells
varies from 2 numbers to a 8 numbers. Any advice will be useful, THANKS!!!


try
=TRIM(text)





All times are GMT +1. The time now is 09:34 AM.

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