Shading Selected Cells

mattyn

Board Regular
Joined
Apr 20, 2015
Messages
148
Good Day All

New to the forum, but relatively competenent with the basics of Excel. I will be asking a lot of questions as I try to expand my knowledge, so i thank you all in advance.

First one: A worksheet that acts as a personnel management whereabouts tool. I want to be able to selct a few cells, and then click a button with an associated macro so that those selected cells are then shaded a particular colour.

For instance, I select A15:G15 with the mouse, then click a button to shade it green.

Hope this makes sense? Is it possible?

Cheers

Matt
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Just make the selection then in the "ribbon" at the top of the screen click the tin of paint below "PAGE LAYOUT" to fill the background or the coloured "A" to colour the text. Use the dropdowns to the right of the icons to select other colours
 
Upvote 0
Just make the selection then in the "ribbon" at the top of the screen click the tin of paint below "PAGE LAYOUT" to fill the background or the coloured "A" to colour the text. Use the dropdowns to the right of the icons to select other colours

Thank you for the reply. This is the current method but falls over as the S/S is used by a number of people, all with differing colour perception and most without the same sense of OCD as I do - there is a lot of "That'll do" here, which infuriates me.
 
Upvote 0
Add this on a module via VBA so use Alt + F11 on the keyboard then Insert menu and module, paste the code in.

When the user wants to do it they can run the macro (Alt + F8) in excel user screen or attach the macro to a button.
 
Upvote 0
Add this on a module via VBA so use Alt + F11 on the keyboard then Insert menu and module, paste the code in.

When the user wants to do it they can run the macro (Alt + F8) in excel user screen or attach the macro to a button.

That is great - sorted it. Now how to I do other colours to be assigned to different buttons?

Greta help, thank you!
 
Upvote 0
Highlight VBGreen and Press F1 (Help) this will show you the VB Colours you can use now if that is Ok then that's sorted, if you need other colours run this bit of code to check out the colours available and then you can add a number to each cell in column B this will give you the numbers against the colour.

sub displayColour()
Sheets.Add
dim I as Long
For I = 1 to 56
cells(n,1).Interior.ColorIndex = I
next I
End sub
 
Upvote 0

Forum statistics

Threads
1,223,262
Messages
6,171,080
Members
452,377
Latest member
bradfordsam

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