Can I create a toolbar or button to apply a number format?

CHBC1

New Member
Joined
Aug 10, 2015
Messages
21
I want to create a toolbar or a button that I can press to apply a custom number format (it's basically just putting the numbers into millions). Does this require VBA? I have basic VBA skills, so I would be willing to go that route, however I normally try to avoid putting VBA in spreadsheets I use at work.

I understand this is probably a newbie question, but I appreciate the help!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi,

I can do it with some VBA. You need to paste this code into a standard code Module.
Code:
Sub MillionFormat()
    Selection.NumberFormat = "#.##,,"" M"";"
End Sub

Now add a button to the Quick Access Toolbar to run the macro.

After that, to format cells just select them and hit the button.

You could put the macro into a Personal workbook and then it would not need to be added to every workbook you used.
 
Upvote 0

Forum statistics

Threads
1,215,111
Messages
6,123,159
Members
449,098
Latest member
Doanvanhieu

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