Format numbers with VBA Macro

blelli

Board Regular
Joined
Jul 21, 2013
Messages
73
Dears,

I have a spreadsheet where I would like to write a frequency in the cell A1, and the system will insert this value, formated, in the cell A2.
No matter the format I write, the system will always respect the following format "1XX.XX"

Example:
If I write 118.95, the system will write 118.95
If I write 18.95, the system will write 118.95
If I write 1895, the system will write 118.95
If I write 1189, the system will write 118.90

How can I do it?

Thanks a lot
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I have a spreadsheet where I would like to write a frequency in the cell A1, and the system will insert this value, formated, in the cell A2.
No matter the format I write, the system will always respect the following format "1XX.XX"

Example:
If I write 118.95, the system will write 118.95
If I write 18.95, the system will write 118.95
If I write 1895, the system will write 118.95
If I write 1189, the system will write 118.90
Would you ever write 189 and, if you did, would the answer be 189.00 or 118.90 and why?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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