Copy custom number formats from one sheet to another

mawallace

New Member
Joined
Mar 5, 2015
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have a custom number format which I use in most of my workbooks.

Normally I will define it in each workbook.

Is there a way that I can make that custom format available in all workbooks and / or in my default worksheet?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
You could create a macro that applies your custom format to the selected range (whatever that may be).

For example, your code may look something like this:
VBA Code:
Sub MyCustomFormatMacro()
    Selection.NumberFormat = "mmm-dd-yy"
End Sub

Then, if you save this VBA code to your Personal Macro workbook, it will be available to you whenever you have Excel open on your computer.
So, you could then just select whatever range you want to apply it to, and run the macro.

Alternatively, if you are always applying it to the same range, maybe look at creating an Excel template that is already pre-formatted for you?

Anyway, those are a few options that hopefully help.
 
Upvote 0
Thank you - is there a way to do this without coding? The range is not always the same
 
Upvote 0
If you follow the method I proposed, it does not matter which range you want to apply it to.
You would just select whatever range you want to apply it to, and then run the macro (note in my code, I am using "Selection" instead of a definite range, so it will run against whatever is the selected range at the time).

If you want to see if you can use a non-VBA solution, have a look here, and see if any of these suggestions work for you: How to save and apply custom number formats in Excel?
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top