Number Stored As Text - Convert to number in code

divster27

New Member
Joined
Jan 19, 2021
Messages
35
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I get a daily spreadsheet from a supplier where a few of the columns need converting to number, which i can do by selecting the cells, right click, convert to number

1736758948688.png


I tried storing this as part of a macro, but i can't get it to work.

Is there a code snippet i could add into my macro to get it to work?

David
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Probably like

VBA Code:
with sheet1.usedrange
   .value = .value
end with
 
Upvote 0
Thanks for getting back to me, but i'm not a coder, so i can't get that to work

Fist of all i need to sleect the range of cells i need to convert, then apply an action - the below is what i have tried
Click on Cell N2
Then select all from that point down
then?
thanks for any help

With Range("N2").Select
Range(Selection, Selection.End(xlDown)).Select
.Value = .Value
End With
 
Upvote 0
It should not make any difference. remove all code and paste this

VBA Code:
Sub jec()
 With Activesheet.UsedRange.Columns(14)
   .Value = .Value
 End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,225,490
Messages
6,185,294
Members
453,285
Latest member
Wullay

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