Trimming Blanks using VB

craig80

Board Regular
Joined
May 18, 2010
Messages
51
Hi All,

I have a data set of about 20k rows, exported from a not so friendly DB, that has blanks all over. It is causing havoc with my VB and Dates!

Can anyone help me to TRIM all the data.

Ideally some VB just to pop into the clean up loop I have on for formatting.

Any advice would be great.

Thanks

Craig
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I have had a bash with this, some of the VB removes the space by specifying it as a CHR(160).

But it loops round forever, and isn't as pratical as I had hoped.

I am looking to transpose =TRIM(cell) into VB to cover =TRIM(Range), but dont konw where to start?

thanks

Craig
 
Upvote 0

Forum statistics

Threads
1,214,840
Messages
6,121,895
Members
449,058
Latest member
Guy Boot

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