VBA remove extra spaces

neveu

Board Regular
Joined
Jan 27, 2009
Messages
225
hello,

i have in a range several numbers that contain extra spaces and therefore these are recognized as text.

this is how the numbers would look : " 123.234.567"

could you please help me how to remove the extraspaces and the points (as otherwise this will also be recognized as text)?

thank you
 
Why do you leverage this? Is it to speed it up? I have 13,000 rows and this is taking a very long time to run. The .TextToColumns I have earlier in the program executes very quickly on the same rows...

With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
This made it run WAY FASTER!!!!!

I added steps to re-instate the updating/calculation/events before the script completes.
 
Upvote 0
Why do you leverage this? Is it to speed it up? I have 13,000 rows and this is taking a very long time to run. The .TextToColumns I have earlier in the program executes very quickly on the same rows...

With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
.EnableEvents = False

As you found out, this dramatically speeds up the runtime. By turning off screen updating, the processor does not have to pause the macro, refresh the screen, and unpause the macro. By turning off calculations, it prevents Excel for wanting to recalculate every time a dependent cell is altered. And turning off events is a general toggle used to prevent things such as Worksheet_Change events from running.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top