<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Color a Cell With a Double-Click In Excel</title>
	<atom:link href="http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/feed" rel="self" type="application/rss+xml" />
	<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel</link>
	<description>The DIY source for aspiring entrepreneurs.</description>
	<lastBuildDate>Sun, 22 Jan 2012 03:18:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Joe</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-16107</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Mon, 09 Jan 2012 03:29:22 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-16107</guid>
		<description>This double clicking code works perfect for what I want.  Is there a way to have this routine applied to every sheet in a workbook without manually adding it to each sheet? For example I have a &quot;master&quot; sheet that is formatted with all the code and conditions I want. Then the user simply adds a new sheet and copies the master over to the new sheet. The routines however do not copy with it. 


Nawabi:
To change the font color use &quot;Target.Font.ColorIndex = x&quot; where x is your color (below you can see where I added in):
        &#039; Then change the background color to red
        Target.Interior.ColorIndex = 3
        Target.Font.ColorIndex = 1</description>
		<content:encoded><![CDATA[<p>This double clicking code works perfect for what I want.  Is there a way to have this routine applied to every sheet in a workbook without manually adding it to each sheet? For example I have a &#8220;master&#8221; sheet that is formatted with all the code and conditions I want. Then the user simply adds a new sheet and copies the master over to the new sheet. The routines however do not copy with it. </p>
<p>Nawabi:<br />
To change the font color use &#8220;Target.Font.ColorIndex = x&#8221; where x is your color (below you can see where I added in):<br />
        &#8216; Then change the background color to red<br />
        Target.Interior.ColorIndex = 3<br />
        Target.Font.ColorIndex = 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-15653</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 04 Nov 2011 17:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-15653</guid>
		<description>Thanks for this, appreciate it!</description>
		<content:encoded><![CDATA[<p>Thanks for this, appreciate it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nawabi</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-15198</link>
		<dc:creator>Nawabi</dc:creator>
		<pubDate>Mon, 05 Sep 2011 07:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-15198</guid>
		<description>very good micro for change cell color but i want change the text color with double click in excel. do you know?
if you know please teach me.
i&#039;ll wait your answer.


Nawabi</description>
		<content:encoded><![CDATA[<p>very good micro for change cell color but i want change the text color with double click in excel. do you know?<br />
if you know please teach me.<br />
i&#8217;ll wait your answer.</p>
<p>Nawabi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared Newnam</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-15046</link>
		<dc:creator>Jared Newnam</dc:creator>
		<pubDate>Sun, 14 Aug 2011 04:13:57 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-15046</guid>
		<description>Hey Dan,

        I thought this was a great tutorial. I customized it to my needs. There&#039;s one question I have for you. I&#039;m trying to avoid a specific range of cells from changing color when it&#039;s double-clicked. 

Can you provide some insight into this? 

-Jared</description>
		<content:encoded><![CDATA[<p>Hey Dan,</p>
<p>        I thought this was a great tutorial. I customized it to my needs. There&#8217;s one question I have for you. I&#8217;m trying to avoid a specific range of cells from changing color when it&#8217;s double-clicked. </p>
<p>Can you provide some insight into this? </p>
<p>-Jared</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-14240</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Thu, 10 Mar 2011 05:20:58 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-14240</guid>
		<description>Tomas,

Re: How to Color a Cell With a Double-Click In Excel

I sent a question earlier today and since then I discovered where I was going wrong. I’m a neophyte to VBA for Excel and I did not understand the basics of where to put the code for BeforeDoubleClick events. I think I’ve got that part straightened out but, nevertheless, I am getting an error message when I double click a cell. The message is this:

Run-time error ’1004’:
Application-defined or object-defined error 

When I click Debug, the following line of the code is highlighted:

Target.Interior.ColorIndex = 3

I am using Excel 2007. Thanks for any help you can give.

Dennis</description>
		<content:encoded><![CDATA[<p>Tomas,</p>
<p>Re: How to Color a Cell With a Double-Click In Excel</p>
<p>I sent a question earlier today and since then I discovered where I was going wrong. I’m a neophyte to VBA for Excel and I did not understand the basics of where to put the code for BeforeDoubleClick events. I think I’ve got that part straightened out but, nevertheless, I am getting an error message when I double click a cell. The message is this:</p>
<p>Run-time error ’1004’:<br />
Application-defined or object-defined error </p>
<p>When I click Debug, the following line of the code is highlighted:</p>
<p>Target.Interior.ColorIndex = 3</p>
<p>I am using Excel 2007. Thanks for any help you can give.</p>
<p>Dennis</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-14239</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Thu, 10 Mar 2011 00:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-14239</guid>
		<description>Tomas,

Re: How To Color a Cell With a Double-Click In Excel, 11-06-2007

This does not work for me in either Excel 2003 or 2007. First of all, when I right-click in a worksheet, there is no “View Code” option. So I open the VB editor with Alt-F11, insert a Module, and paste in your code. When I go back to the worksheet and go to Tools, Macros, nothing is in the Macro dialog box. The box prompts me to enter the name of the Macro, which I do: Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean). But the Run button is not active. When I try running the routine from the VB editor, I get the same empty Macro dialog box. I’ve also tried double-clicking in cells on the worksheet, thinking this might activate the macro, but nothing happens. The workbook is macro enabled, so that’s not the problem. What am I doing wrong? This is a good idea that I could use, so any help is greatly appreciated.

Dennis</description>
		<content:encoded><![CDATA[<p>Tomas,</p>
<p>Re: How To Color a Cell With a Double-Click In Excel, 11-06-2007</p>
<p>This does not work for me in either Excel 2003 or 2007. First of all, when I right-click in a worksheet, there is no “View Code” option. So I open the VB editor with Alt-F11, insert a Module, and paste in your code. When I go back to the worksheet and go to Tools, Macros, nothing is in the Macro dialog box. The box prompts me to enter the name of the Macro, which I do: Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean). But the Run button is not active. When I try running the routine from the VB editor, I get the same empty Macro dialog box. I’ve also tried double-clicking in cells on the worksheet, thinking this might activate the macro, but nothing happens. The workbook is macro enabled, so that’s not the problem. What am I doing wrong? This is a good idea that I could use, so any help is greatly appreciated.</p>
<p>Dennis</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kat</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-13282</link>
		<dc:creator>Kat</dc:creator>
		<pubDate>Sun, 14 Mar 2010 12:38:38 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-13282</guid>
		<description>I hope this isn&#039;t a stupid question...
I just used this code in a Excel 2003 and it worked great!

But then I switched to Excel 2007 and the code is not working in the same file.  The sheet is not locked, and I can access the code (ie. function was installed), but it&#039;s not working.

Is it possible I have something switched on/off disabling the function of this VBA code in Excel 2007?

Many thanks for any assistance  :)</description>
		<content:encoded><![CDATA[<p>I hope this isn&#8217;t a stupid question&#8230;<br />
I just used this code in a Excel 2003 and it worked great!</p>
<p>But then I switched to Excel 2007 and the code is not working in the same file.  The sheet is not locked, and I can access the code (ie. function was installed), but it&#8217;s not working.</p>
<p>Is it possible I have something switched on/off disabling the function of this VBA code in Excel 2007?</p>
<p>Many thanks for any assistance  <img src='http://theclosetentrepreneur.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TOMAS</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-12986</link>
		<dc:creator>TOMAS</dc:creator>
		<pubDate>Mon, 19 Oct 2009 18:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-12986</guid>
		<description>@Seth - Sure, just add an additional Else/Then statement that goes to your second color as shown below (you still need the full code that goes before and after the statments):

...
 
&#039; If the cell is clear
If Target.Interior.ColorIndex = xlNone Then
 
&#039; Then change the background color to red
Target.Interior.ColorIndex = 3
 
&lt;strong&gt;&#039; Else if the cell background color is red
ElseIf Target.Interior.ColorIndex = 3 Then

&#039; Then change the background color to blue
Target.Interior.ColorIndex = 5&lt;/strong&gt;

&#039; Else if the cell background color is blue
ElseIf Target.Interior.ColorIndex = 5 Then
 
&#039; Then clear the background
Target.Interior.ColorIndex = xlNone
 
...

@Sim - To get different ranges with different colors, just use the intersect method that I outlined in &lt;a href=&quot;http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-12718&quot; rel=&quot;nofollow&quot;&gt;this comment above&lt;/a&gt; and add a second &quot;If Intersect...&quot; section with a different range and color choice.</description>
		<content:encoded><![CDATA[<p>@Seth &#8211; Sure, just add an additional Else/Then statement that goes to your second color as shown below (you still need the full code that goes before and after the statments):</p>
<p>&#8230;</p>
<p>&#8216; If the cell is clear<br />
If Target.Interior.ColorIndex = xlNone Then</p>
<p>&#8216; Then change the background color to red<br />
Target.Interior.ColorIndex = 3</p>
<p><strong>&#8216; Else if the cell background color is red<br />
ElseIf Target.Interior.ColorIndex = 3 Then</p>
<p>&#8216; Then change the background color to blue<br />
Target.Interior.ColorIndex = 5</strong></p>
<p>&#8216; Else if the cell background color is blue<br />
ElseIf Target.Interior.ColorIndex = 5 Then</p>
<p>&#8216; Then clear the background<br />
Target.Interior.ColorIndex = xlNone</p>
<p>&#8230;</p>
<p>@Sim &#8211; To get different ranges with different colors, just use the intersect method that I outlined in <a href="http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-12718" rel="nofollow">this comment above</a> and add a second &#8220;If Intersect&#8230;&#8221; section with a different range and color choice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sim</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-12928</link>
		<dc:creator>Sim</dc:creator>
		<pubDate>Wed, 23 Sep 2009 13:15:43 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-12928</guid>
		<description>Hi
     Thanks for the great info.
Is it possible to to have different ranges with different colours. For example if I double click on cells A1:A10 they turn red and then I double click on cells B1:B10 they turn green?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi<br />
     Thanks for the great info.<br />
Is it possible to to have different ranges with different colours. For example if I double click on cells A1:A10 they turn red and then I double click on cells B1:B10 they turn green?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel/comment-page-1#comment-12910</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Sat, 12 Sep 2009 20:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://theclosetentrepreneur.com/how-to-color-a-cell-with-a-double-click-in-excel#comment-12910</guid>
		<description>Thank you so much for this. Can you take it one step further and make it so the first time you double click it changes to one specified color, then on second double click it changes to a second specified color, and on third double click goes back to its orginal state? PLEASE??

Thank you!!!</description>
		<content:encoded><![CDATA[<p>Thank you so much for this. Can you take it one step further and make it so the first time you double click it changes to one specified color, then on second double click it changes to a second specified color, and on third double click goes back to its orginal state? PLEASE??</p>
<p>Thank you!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

