I've successfully created a PP slide where I can enter values and click a
"calculate" button to automatically see my results ...
What I can't seem to do however is format the results as either a number
with the thousands separator, or as currency - either USD or Euro.
My (partial) code currently looks like this:
Private Sub Calculate_Click()
On Error GoTo Err1
Annual_Departures1.Value = Daily_Departures.Value * 365
Annual_Departures2.Value = Daily_Departures.Value * 365
Annual_Departures3.Value = Daily_Departures.Value * 365
Taxi_Ops1.Value = Annual_Departures1.Value * 2
Taxi_Ops2.Value = Annual_Departures1.Value * 2
Taxi_Ops3.Value = Annual_Departures1.Value * 2
TROT1.Value = Taxi_Ops1.Value * 15 / 3600
TROT2.Value = Taxi_Ops1.Value * 22.5 / 3600
TROT3.Value = Taxi_Ops1.Value * 30 / 3600
Savings1.Value = TROT1.Value * OC.Value
Savings2.Value = TROT2.Value * OC.Value
Savings3.Value = TROT3.Value * OC.Value
GoTo Done
Err1:
MsgBox "Please enter values for both 'Airline Daily Departures' and
'Operating Cost per Hour' before calculating.", vbOKOnly, "Calculating
Error
Message"
Done:
End Sub
Private Sub Savings1_Change()
End Sub
Private Sub Savings2_Change()
End Sub
Private Sub Savings3_Change()
End Sub
I've done some research on VB coding and I see where they have codes for
currency formatting, but I can't figure out WHERE to put the codes ...
Any help you could provide is greatly appreciated!
Regards,
Shanda
Use them wherever you want to display text. It's not clear from your code
what each of the controls is, so it's hard to say where things fit.
For a textbox, you'd do something like:
Me.txtAirFare.Text = Format(Airfare, "000000.00")