VBA Macro Convert to number code

Aliq2014

New Member
Joined
Sep 10, 2014
Messages
46
Hello, I have a question is there a way to write a code to loop through a given column and convert each cell to a number?

Cell A - Number in cell formated as text Desire Result Cell A- Converted to number
561 561
562 562
.
.
70 70
.
.
700 700

Help is really appreciated.

Thanks,
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Select the column, Data > Text to columns, Finish.
 
Upvote 0
I think you mean

Code:
Columns("D").Value = Columns("D").Value

But if the cells are formatted as currency, that will round them all to the nearest penny.

Code:
Columns("D").Value2 = Columns("D").Value2
... is safer.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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