Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Format Control Toolbox Output

1 view
Skip to first unread message

slstaggs

unread,
May 11, 2010, 4:17:01 PM5/11/10
to
Hello,

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


Steve Rindsberg

unread,
May 11, 2010, 7:40:37 PM5/11/10
to
In article <7FED4FF0-AF5F-4FCE...@microsoft.com>, Slstaggs
wrote:

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")

0 new messages