Help to align FORMAT  
Author Message
Arnd





PostPosted: Fri Feb 01 09:11:36 CST 2008 Top

Excel Programming >> Help to align FORMAT

I use a commandbutton to display gross pay of the current payperiod for two
part-time jobs. It takes three lines and for the most part, everything lines
up.

Problem is if the length of one amount is different than the other, then
they do not line up. Example: $98.00 will not line up with $135.00 since one
has 3 numbers to left of decimal and the other is only 2 numbers to the left.
I tried FORMAT(amt,"##0.00") and FORMAT(amt,"000.00"). The amounts will not
be greater than $999.99.

What format can I use to insure columns line up?

Thanks,
Les

Excel277  
 
 
Nigel





PostPosted: Fri Feb 01 09:11:36 CST 2008 Top

Excel Programming >> Help to align FORMAT Right align them?

--

Regards,
Nigel






>I use a commandbutton to display gross pay of the current payperiod for two
> part-time jobs. It takes three lines and for the most part, everything
> lines
> up.
>
> Problem is if the length of one amount is different than the other, then
> they do not line up. Example: $98.00 will not line up with $135.00 since
> one
> has 3 numbers to left of decimal and the other is only 2 numbers to the
> left.
> I tried FORMAT(amt,"##0.00") and FORMAT(amt,"000.00"). The amounts will
> not
> be greater than $999.99.
>
> What format can I use to insure columns line up?
>
> Thanks,
> Les

 
 
WLMPilot





PostPosted: Fri Feb 01 09:29:03 CST 2008 Top

Excel Programming >> Help to align FORMAT Can that be done within a Msgbox? That is currently how I display what I
want.

Example (code used to display via msgbox):
Const sfmt As String = "$##0.00"
answer = Space(brsspc) & "Belton (" & FormatDateTime(brsdate,
vbShortDate) & "): " & Format(brs, sfmt) & _
vbLf & Space(fixspc) & "Palmetto (" & FormatDateTime(pasdate,
vbShortDate) & "): " & Format(pas, sfmt) & _
vbLf & Space(ttlspc) & "Total: " & Format(brs + pas, sfmt)
ans = MsgBox(answer, vbOKOnly, "Current Payperiod - Estimated Pay")

NOTE: The Space() function is used to determine indent from left since the
date lenght my differ. I am wondering if I need to determine the same thing
for the amount.

Thanks,
Les




> Right align them?
>
> --
>
> Regards,
> Nigel

>
>
>


> >I use a commandbutton to display gross pay of the current payperiod for two
> > part-time jobs. It takes three lines and for the most part, everything
> > lines
> > up.
> >
> > Problem is if the length of one amount is different than the other, then
> > they do not line up. Example: $98.00 will not line up with $135.00 since
> > one
> > has 3 numbers to left of decimal and the other is only 2 numbers to the
> > left.
> > I tried FORMAT(amt,"##0.00") and FORMAT(amt,"000.00"). The amounts will
> > not
> > be greater than $999.99.
> >
> > What format can I use to insure columns line up?
> >
> > Thanks,
> > Les
>
 
 
Nigel





PostPosted: Fri Feb 01 09:49:06 CST 2008 Top

Excel Programming >> Help to align FORMAT Gotcha - a message box!! Not easily especially as proportional fonts
create another problem. Why not create a custom UserForm to emulate a
MsgBox and use that, you then have total control of how things are displayed
and laid out. I would!


--

Regards,
Nigel






> Can that be done within a Msgbox? That is currently how I display what I
> want.
>
> Example (code used to display via msgbox):
> Const sfmt As String = "$##0.00"
> answer = Space(brsspc) & "Belton (" & FormatDateTime(brsdate,
> vbShortDate) & "): " & Format(brs, sfmt) & _
> vbLf & Space(fixspc) & "Palmetto (" & FormatDateTime(pasdate,
> vbShortDate) & "): " & Format(pas, sfmt) & _
> vbLf & Space(ttlspc) & "Total: " & Format(brs + pas, sfmt)
> ans = MsgBox(answer, vbOKOnly, "Current Payperiod - Estimated Pay")
>
> NOTE: The Space() function is used to determine indent from left since
> the
> date lenght my differ. I am wondering if I need to determine the same
> thing
> for the amount.
>
> Thanks,
> Les
>
>

>
>> Right align them?
>>
>> --
>>
>> Regards,
>> Nigel

>>
>>
>>


>> >I use a commandbutton to display gross pay of the current payperiod for
>> >two
>> > part-time jobs. It takes three lines and for the most part, everything
>> > lines
>> > up.
>> >
>> > Problem is if the length of one amount is different than the other,
>> > then
>> > they do not line up. Example: $98.00 will not line up with $135.00
>> > since
>> > one
>> > has 3 numbers to left of decimal and the other is only 2 numbers to the
>> > left.
>> > I tried FORMAT(amt,"##0.00") and FORMAT(amt,"000.00"). The amounts
>> > will
>> > not
>> > be greater than $999.99.
>> >
>> > What format can I use to insure columns line up?
>> >
>> > Thanks,
>> > Les
>>