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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I manipulate the Custom Number Format list?

Status
Not open for further replies.

MigrantFirmWorker

Programmer
Apr 9, 2003
54
US
Anyone know how to access & manipulate the custom format list, aka, Format/Cells/Number/Custom ? When I assign a new format to a cell, it shows up in the list, but I haven't figured out how to query or delete items in the list.
 
Hiya,

Excel stores the number formats within the application itself, and as far as I know there are no objects in VBA to access the list
BUT: have a look on – Leo Hauser wrote some code using SendKeys that’ll read the list of Custom Number Formats. If you want to delete any format you’ll need the text string that defines the format

You can delete numberformats using the .DeleteNumberFormats method (takes the numberformat as argument and applies to the Workbook object) but there’s no way you can delete Excel's built-in custom number formats.

As for adding formats to the list: all you can do is to use VBA to apply the formats you want added to a cell in the workbook where you want to have the formats available.

HTH


Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top