Format question

M

Mike NG

Private Sub Postage_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Postage = Format(Postage, "£ #,##0.00")
End Sub

I have the above code in one of my userforms for formatting the Postage
field when I exit from it

I have two amount fields above each other, and I really want to be able
to use Format so that each are properly right aligned
e.g.
£ 1,000.00
£ 9.99

I have the correct fixed font on each so they will be right aligned if
the right number of spaces are in the appropriate space, but can I get
Format to insert the right number of spaces for me?
 
B

Bob Phillips

Hammer to a nut!

Private Sub Postage_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Postage = Format(Postage, "#,##0.00")
Postage = "£" & Space(10 - Len(Postage)) & Postage
End Sub

and you will need to use a proportional font like Courier


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Phone book formatting 10
Accounting Format not aligned 1
Format a result 2
Date Format code with error now 1
number format 3
Excel crashes 1
Date Validation 2
how can I format a .csv file from external data? 1

Top