MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Multiple fill color buttons

Posted by GLITZ on July 09, 2001 1:11 PM

How can I put a couple of different "fill color" buttons in the same window? I know how to put a bunch of the same ones in a workbook. I would like to have 3 different colored buttons available at the same time, in the same workbook.

Any ideas?


Posted by Ben O. on July 09, 2001 1:28 PM

I think that when you multiple copies of Excel's default fill color button on your toolbar, their colors are linked and can't be separated. What you could is put some macro buttons on your toolbar and assign macros that change cells' colors to them.

Sub FillColorRed()
Selection.Interior.ColorIndex = 3
End Sub

Sub FillColorBlue()
Selection.Interior.ColorIndex = 5
End Sub

Sub FillColorYellow()
Selection.Interior.ColorIndex = 6
End Sub

These three macros change a the selected cell's color to red, blue, and yellow respectively. The downside is that the colors that the buttons are linked to are fixed, so if you wanted one of the buttons to change the color to green rather than red, you'd have to change the code.


Posted by Mark W. on July 09, 2001 4:40 PM

GLITZ, are you aware that the fill toolbar's
dropdown palette can be "torn off" and then
allowed to float above the worksheet? This
effectively gives you 40 fill colors at your
finger tips!

Posted by GLITZ on July 10, 2001 4:40 AM

This is kinda what i was looking for.........let me explore the idea of the macro's. Thanks

Posted by GLITZ on July 10, 2001 4:43 AM

Yea, I know about the pull down. I've made a worksheet for an excel rookie, and I want to make it as easy as possible......