ATTN:Paul B - Re: Change cell fill colour on mouse click

  • Thread starter Thread starter PHB
  • Start date Start date
P

PHB

Hi Paul



Thanks for your reply - it seems to be what I'm looking for. However I'm no
expert with Excel. Could you please tell me how I go about getting the
coding you sent into the VB editor as I've never had cause to use this
before.



Thanks for your help - it's much appreciated.



Cheers





Paul Bardsley J
 
Right click on the sheet tab, view code, insert the code.

Suggest you paste the code as Paul supplied it so you will see color
turn red indicating a syntax error caused by splitting a line
without using the break character which is space then underscore.
You can break the line anywhere with the break character.

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
With Selection.Interior
.ColorIndex = 34 'change to the color you want
.Pattern = xlSolid
End With
End Sub


One of the advantages of having a web site or in pointing to
a webpage is that all of the information needed can be kept
together. But that also applies to a thread it helps if you
stick to the same thread, so everything is kept together, it
makes it a lot easier on everyone if you don't continue a
thread by starting a new thread.
 
To, add to David's post, if you are using excel 2000 or newer you may have
to change the macro security settings to get the macro to run. To change the
security settings go to tools, macro, security, security level and set it to
medium

David, thanks for the catch on the line break, I did not notice the work
wrap when I posted

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
 
"work wrap" how did that happen, k is on the other side of the key board
from d!

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
 
Thank you for all your help, chaps. This is just what I need.
I promise to post properly in future (I hope to *** that this one goes into
the correct place!)

Thanks again

PAUL :-)
 
Back
Top