Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting of numbers in Word 2000 VBA

Status
Not open for further replies.

carl777

Instructor
Oct 1, 2002
20
US
How does one control the formatting of numbers (for displaying or printing) in Word 2000 VBA? I'm getting 14 decimal places, and only want one decimal place.
Also, how do you place more than one command on a line in Word VBA? (What's the separator/delimiter between commands?)
And lastly, does anyone know of a good source for common VBA commands and syntax? The garbage I've been able to find in Office 2000 is inapproprite and far too complex.
 
NumberToFormat = Format(NumberToFormat, "#,##0.00")

Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Thank you. That did it! Can you also tell me how to put more than one command on a line? Is here a separator I can use between commands?
 
Carl, don't know whether this is actually possible, but even if it is it's a REALLY bad idea. Keep in mind that the life of your code is usually a lot longer than you originally anticipate. Your code needs to be easy to read not only now, but in 5 years time and by someone other than yourself.

Trying to decipher what's going on in poorly structured code is a nightmare, so always keep it simple to read, with indented lines where appropriate, comments within the code itself, and comments at the start of your code explaining the overall purpose, inputs and outputs used.

[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top