Micron,Maybe I don't understand the question, because I typed what you show and chose OK, then applied the format to a cell. When I open the dialog again, what I entered is still there.
View attachment 120106
Sub MyCustomFormat()
Selection.NumberFormat = "#,##0.00;[Red](#,##0.00)"
End Sub
If you do not have one, you can easily create one by doing the following steps:It seems I don't have a personal.xls (xlsb or otherwise). I was wondering if you put the format in that wb would it be available to all open wb's? Can't test it though. At one time I thought it was automatic to have one but it seems that now it isn't.
Hi Micron, As Joe4 mention the format only stays in the same workbook. I want that specific format permanent when i go into Customs so i do not have to amend manually. Hope this helps. thank you everyone who replied, much appreciated. Will try some of the macros as wellMaybe I don't understand the question, because I typed what you show and chose OK, then applied the format to a cell. When I open the dialog again, what I entered is still there.
View attachment 120106
Hi Joe4, yes you are correct, i am looking for a permanent solution as you rightly say it does not come up on new work bookMicron,
I did some testing, and what you said is true, but only within that particular workbook.
It does not apply/show in other workbooks you may have open (or if you create a new one).
I think maybe they are looking for a permanent solution that is always available in all workbooks.
praf007,
If that is indeed the case, one way would be to create a short little macro that does that, and save it in your Personal Macro Workbook.
The code is a real simple one-line procedure, like this:
VBA Code:Sub MyCustomFormat() Selection.NumberFormat = "#,##0.00;[Red](#,##0.00)" End Sub
So all you would have to add after you add it to your Personal Macro Workbook is first select the range you want to apply it to, and then call/run it from the Macro Listing (View -> Macros -> View Macros), i.e.
View attachment 120107
(as you can see, I have a lot of other macros in there - if this is your first, it would be the only one listed).
Macros stored in your Personal Macro Workbook are always available to you while you are logged in to that particular computer.
See here for information on the Personal Macro Workbook: Excel Personal Macro Workbook: how to create, use and share