% Sign to Show on a User Form

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
982
Office Version
  1. 2021
Platform
  1. Windows
Code:
Private Sub Percent_Button_Click()
On Error GoTo ErrorHandler

Percent_Input = 1 - (REV_Input / Budget_Input)
Selection.Style = "Percent"
Exit Sub
    
ErrorHandler:
MsgBox ("Both REV and Budget Fields Must Have a Number Input")

End Sub

Hello All,
I have an annoying problem here with my user form. Above is my code so when I select the Percent Button, the corresponding field should show a number with the percent sign. For example, if I have REV_Input as 5, and Budget_Input as 10, the Percent_Input field keeps showing .5...instead of 50%, like I would like. How do I get the % sign to show in the corresponding user form field?
Thanks for the help
excel 2013
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Use the Format function.
Code:
Percent_Input = Format(1 - (REV_Input / Budget_Input), "0%")
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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