View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Two short questions

On Sun, 27 Jan 2008 10:43:01 -0800, WLMPilot
wrote:

1) How is a variable DIM if it might hold decimal places?


DIM dNum as Double



2) Ref Msgbox, how do I show multiple lines within Msgbox?


Separate the lines with vbLf

I have two
part-time jobs and I want to display the estimated pay for each for current
payperiod and then a total. I can get it on one line, but I would like to
show each job on separate line and lined up so I can display total amount too.

EXAMPLE: EMS Job1: $100.00
EMS Job2: $235.00
TOTAL: $335.00


For example:

================================
Option Explicit
Sub foo()
Const dVar1 As Double = 100
Const dVar2 As Double = 235
Const sFmt As String = "$#,##0.00"

MsgBox ("EMS Job 1: " & Format(dVar1, sFmt) & _
vbLf & "EMS Job 2: " & Format(dVar1, sFmt) & _
vbLf & "TOTAL: " & Format(dVar1 + dVar2, sFmt))

End Sub
====================================

--ron