I need to change my output to 2 decimals even if input hass no decimals.

ErinAline

New Member
Joined
Feb 21, 2023
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
I am wanting to have a userform which brings in my information from the user and then outputs it to a spread sheet but I can't figure out how to get it to output in 2 decimal places if the user does not put in the value with any decimal places. I want it to always output to 2 decimals regardless of the users input significant figures. I've tried using NumberFormat but that hasn't gotten me anywhere



Cells(flightrow, 4) = "SECTIONAL FLIGHT, " & handcombo.Text & " , Ø" & FlightIDTextBox.NumberFormat = "0.00" & quote & " ID X Ø" & FlightODTextBox.Value & quote & "OD X " & FlightPitchTextBox.Value & quote & " PITCH"

Any help is greatly appreciated!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi,
You could test following
Replace
& FlightIDTextBox.NumberFormat = "0.00"
by
& Format(FlightIDTextBox ,"#,##0.00")

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,793
Members
449,048
Latest member
greyangel23

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