Click to change the cell colour in Excel



Click to change the cell colour in Excel. Double click on the cell to turn it red. Right click on the cell to turn it green.
Check out my online courses

code
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 3
End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 4
End Sub

For more help visit my website or email me at easyexcelanswers@gmail.com.

Contact me regarding customizing this template for your needs.

Excel one-on-one on-line training available. Email me to arrange.

I am able to provide online help on your computer at a reasonable rate.

Check out my next one-hour Excel Webinar

I use a Blue condensor Microphone to record my videos, here is the link

Check out Crowdcast for creating your webinars

If you need to buy Office 2019 follow

I use Tube Buddy to help promote my videos
Check them out

Follow me on Facebook

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
20 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
thewowcollector

Just saw this and the changes work well – but I was wondering can I use RGB codes for the colors? Additionally, how could I add it so it will change the font style (i.e. bold), and color of the font all at once? Thanks

Balıkçı Kral

Hi Barb thanks for help… but how can i change just text color

L Wran

Hi Barb, great tip works a treat however, how do I then remove the colour from the sheet if needed? Thanks in advance from Australia.

Samir Awati

thank a lot, can we make micro of this please reply,

Kerim

Thanks for that!

Is it possible to align to code only to specific rows / cells?

For example could I code it that the green colour change on a double click should only apply to the cells E9 to J9 all the way down to E68 to J68?

mzoffy1

I paste this code but I get a "Compile error: Invalid ourside procedure". Any ideas welcome. Running Office pro plus 2019

Lu Min Kyaw

Can use more than 2 colours?

nithin s

God bless u mam

Rayson Ho

How to apply this to merged cells too?

hi Barb, thanks for this code.. but how can i use it only for say, colum A or Colum B

Jdawg Wad

That is so AWESOME!!! I have never been able to get any code to work. But this did. Thank you!!!

romantashev

How do you reset the color of the cell?

Tropical Magic

Clearest and fastest!

navag 007

How to change the colour?

Elayna Witt

Is there a way to create a chart based on how many is red and how many is green?

Carlos Suazo

Great & Easy!! Thank You.

Jose Carlos do Nascimento

Thanks from Brazil!

Gnana Pradeep

How to change the color to normal

Sanjay Shah

After i save and exit and reopen it other time the formula does not work..plz help.

hurrem sultan

how did you set those toolbar inquire,acrobate,cashbook,item etc and more? how? please we want a videos about that settings