Hi Joe 4 i will try the macro. thank youMicron,
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
Hi Joe4, I have a macro set up. But when i want to run macro in a new file I have to open the macro file as well. How can I run macro without opening the file where the macro is in? I know this is a silly questionIf you do not have one, you can easily create one by doing the following steps:
Go to View -> Macros -> Record Macro
and then select the "Personal Macro Workbook" option, as shown below:
View attachment 120114
Then you can go back to View -> Macros -> Record Macro and click "Stop Recording".
Then if you view the VB Editor, you should be able to see the Personal Macro Workbook.
It doesn't normally open hidden when created, it normally needs hiding manually and saving the first time as it is just a .xlsb file with the name Personal (it should automatically open though if still in the XLSTART folder)should automatically open hidden
I would wager that is already in the list as part of a regular install of Excel. It is in mine, and I can assure everyone that there's no way I added it to the list of custom formats (or any other list).#,##0.00_);[Red](#,##0.00)
FYI - I opened my Excel without the Book.xltx in the start up folder and a red with parentheses is not in my custom formats.I would wager that is already in the list as part of a regular install of Excel. It is in mine, and I can assure everyone that there's no way I added it to the list of custom formats (or any other list).
ThanksAlex, Will try thatI don't believe you need to use a macro.
Create the Custom format in a New Workbook and then save it to your XLStart folder as an "Excel Template (*.xltx)" file named Book.xltx and then also as Sheet.xltx.
(the option is about the 9th option in the save as drop down box)
The format should then be available when you create a new workbook and when you create a sheet in an existing workbook.
I would recommend using something that looks closer to this though:
#,##0.00_);[Red](#,##0.00)
The trailing "_)" on the positive should ensure that the numbers align by leaving a space with the size of ")" to the right of the positive number.
Note: When you copy it in to the Custom box make sure that to delete the space after the ")", when I tried to copy it in, it seemed to pick up an additional space which throws out the alignment.