Adding toolbar buttons for colors?

cheetahlip

New Member
Joined
Nov 7, 2005
Messages
33
Is it possible to add a seperate toobar button for a highlight color you use quite frequently?

Thanks!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

You could always trying recording a macro to fill a cell with a colour by holding down ctrl+ a letter of your choice.

I've got 3 colour macros set up for my own use (one of them actually emties the colour from the highlighted cells)


Damian
 
Upvote 0
Hi there!

Right click on the sheet tab > View code
In top left hand window select VBA Project
Right click again Insert>Module

Now paste this in:

Sub FillCellyellow()

With Selection.Interior
.ColorIndex = 6 'or whatever colour you're after
.Pattern = xlSolid
End With
End Sub

Now create a custom macro button, right click and assign 'fillcellyellow' macro to it.

Hope that helps!
 
Upvote 0
Zoso and Damian.....Thanks a bunch!! worked like a charm!!!!

Hey Damian, what's the code you used for clearing the color out? I don't like using white because it erases the gridlines.....
 
Upvote 0
Hi again.

Just insert this into the same module and assign the 'nofill' macro to second button:

Sub nofill()
Selection.Interior.ColorIndex = xlNone
End Sub

HTH!
 
Upvote 0
PROBLEM!!! It's a pain in the boot!!

BAD BAD news!!!!!! I added the custom buttons and now my excel goes wacky on me.....the buttons no longer show up, and now toolbars reset and disappear every time I restart excel, and sometimes when I don't restart.....what's causing this mess to happen?????
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,008
Members
448,935
Latest member
ijat

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