Rounding Figures Using VBA

Gavin Harrison

New Member
Joined
May 2, 2017
Messages
34
Hi All.

I am putting together a pop up userform in VBA and within a label i want to display a value of a call in the worksheet.

The cell i am looking up is formatted to 1 decimal place, but then i run the code, it is not.

This is the line of code, is there an easy way to amend this code so that the figure is formatted to 1 decimal place when displayed in the userform?

TimesExportedPopUp.Label5.Caption = Worksheets("Calculations").Range("BD65")

Thanks for your help in advance.
 

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.
TimesExportedPopUp.Label5.Caption = Format(Worksheets("Calculations").Range("BD65"), "0.0")
 
Upvote 0
What exactly is found in cell BD65?
Are you sure that the value in cell BD65 is numeric, and not "numbers entered as text"?
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,940
Members
449,275
Latest member
jacob_mcbride

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