Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had no trouble at all using VBA to assign this format to a cell:
Sub FormatPctNonZero() Selection.NumberFormat = "#,##0.00%;-#,##0.00%;;@" End Sub Alternatively, if you have a Style (i.e. "PctNonZero [1]") defined that applies this format, then the VBA code would look like the following: Sub FormatPctNonZeroStyle() Selection.Style = "PctNonZero [1]" End Sub Just be aware that to use this method, the Style must exist in the workbook, otherwise you will get the following run-time error (at least in Excel 2000): "Run-time error '450': "Wrong number of arguments or invalid property assignment." -- Regards, Bill Renaud |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
worksheet calculate | Excel Programming | |||
Worksheet will not calculate | Excel Discussion (Misc queries) | |||
how do i set up a worksheet to calculate the inventory? | Excel Worksheet Functions | |||
Can I calculate just one worksheet in a multi-worksheet workbook? | Excel Discussion (Misc queries) |