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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,836
Office Version
  1. 2010
Platform
  1. Windows
Select the column, Data > Text to columns, Finish.
 
Upvote 0

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,836
Office Version
  1. 2010
Platform
  1. Windows
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,195,625
Messages
6,010,754
Members
441,568
Latest member
abbyabby

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
Top