View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Two short questions

For the Border, no, it cannot be used in a message box. It applies to a
worksheet cell or group of cells. See Borders Property in VBA Help file.

"WLMPilot" wrote:

Not sure what you mean about checking Accounting Format. Is there a
different format to use to get it to line properly?

As for the Border Property, can that be used in a Msgbox?

Thanks,
Les

"JLGWhiz" wrote:

Hi Les, For the alignment, check out the Accounting format. For the
underline, you will need to use the Borders property to set the bottom border
of the cell above the total or the top border of the cell with the total to a
double line style.

"WLMPilot" wrote:

Thanks. Worked great. However I have two more questions in order to tweak
the display.

1) the format I used ("$##0.00) causes the numbers to not line up. If
there is no money made on a job, then I get $0.00, when I need $ 0.00. How
can I get the spaces in there? I tried "$000.00" also.

2). I want to underline between 2nd line and Total. How do I get the
underline in there?

Thanks again!!

Les

"Ron Rosenfeld" wrote:

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