VBA to convert the range B in number format??

rohitw2

New Member
Joined
Mar 24, 2017
Messages
9
Hi All,

I need a help where I have the numbers in column B but they are not in the number format. So I want the moment my macro paste the data in column B, it should convert that column in number format. I have tried multiple time but it only paste the data in as usual format.

Kindly advise

AB
DateAmt
25-03-17500
15-02-176985
20-03-1784
12-01-177321

<tbody>
</tbody>

 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Have you tried using the Macro Recorder to generate the VBA you need?
 
Upvote 0
Hi All,

I need a help where I have the numbers in column B but they are not in the number format. So I want the moment my macro paste the data in column B, it should convert that column in number format.

Add these two lines of code immediately after the code that puts the numbers in Column B...

Columns("B").NumberFormat = "General"
Columns("B").TextToColumns
 
Upvote 0
will this make my data in column B in number format as i have to use it for my further calculations.
 
Upvote 0
will this make my data in column B in number format as i have to use it for my further calculations.
The cells will be formatted as General (the default for cells in Excel) so the code I gave you would result in the cell containing a real number if the text in the cell is a proper representation of a number (just like if you had typed it in manually).
 
Upvote 0
https://1drv.ms/i/s!ArrD_eUdmgj1jgQcqBO4mpV0uv_z

I have
share the snap shot link kindly look into it where i need to do the convert all items in range in number format without using the mouse.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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