is there a simple way to color a cell with a right click (excel2003) ?
is there a simple way to color a cell with a right click (excel2003) ?
Hi Newbie,
Perhaps a the response to a double click would meet your needs?
Try:
'=============>>
Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
Target.Interior.ColorIndex = 6 '<<== CHANGE
End Sub
'<<=============
This is worksheet event code and should be pasted into the worksheets's code
module (not a standard module and not the workbook's ThisWorkbook module):
Right-click the worksheet's tab
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.
---
Regards,
Norman
"Newbie" <[email protected]> wrote in message
news:[email protected]...
> is there a simple way to color a cell with a right click (excel2003) ?
works like a dream. Thank you Norman.
"Norman Jones" wrote:
> Hi Newbie,
>
> Perhaps a the response to a double click would meet your needs?
>
> Try:
>
> '=============>>
> Private Sub Worksheet_BeforeDoubleClick _
> (ByVal Target As Range, Cancel As Boolean)
> Target.Interior.ColorIndex = 6 '<<== CHANGE
> End Sub
> '<<=============
>
> This is worksheet event code and should be pasted into the worksheets's code
> module (not a standard module and not the workbook's ThisWorkbook module):
>
> Right-click the worksheet's tab
> Select 'View Code' from the menu and paste the code.
> Alt-F11 to return to Excel.
>
>
> ---
> Regards,
> Norman
>
>
> "Newbie" <[email protected]> wrote in message
> news:[email protected]...
> > is there a simple way to color a cell with a right click (excel2003) ?
>
>
>
Norman:
Seeing this reminds me (daaa) - seems like a double-click caused excel to
think you wished to Edit a cell and thereby a Cancel = True line needed to be
entered -- before proceeding with the code. Can you clarify my confusion?
Thanks always for you great contribution to these NG's..
Jim May
"Norman Jones" wrote:
> Hi Newbie,
>
> Perhaps a the response to a double click would meet your needs?
>
> Try:
>
> '=============>>
> Private Sub Worksheet_BeforeDoubleClick _
> (ByVal Target As Range, Cancel As Boolean)
> Target.Interior.ColorIndex = 6 '<<== CHANGE
> End Sub
> '<<=============
>
> This is worksheet event code and should be pasted into the worksheets's code
> module (not a standard module and not the workbook's ThisWorkbook module):
>
> Right-click the worksheet's tab
> Select 'View Code' from the menu and paste the code.
> Alt-F11 to return to Excel.
>
>
> ---
> Regards,
> Norman
>
>
> "Newbie" <[email protected]> wrote in message
> news:[email protected]...
> > is there a simple way to color a cell with a right click (excel2003) ?
>
>
>
Hi Jim,
You are quite correct!
Amending, therefore the code:
'=============>>
Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = 6
End Sub
'<<=============
Thanks for the remonder!
--
Regards,
Norman
"Jim May" <[email protected]> wrote in message
news:[email protected]...
> Norman:
> Seeing this reminds me (daaa) - seems like a double-click caused excel to
> think you wished to Edit a cell and thereby a Cancel = True line needed to
> be
> entered -- before proceeding with the code. Can you clarify my confusion?
>
> Thanks always for you great contribution to these NG's..
>
> Jim May
>
> "Norman Jones" wrote:
>
>> Hi Newbie,
>>
>> Perhaps a the response to a double click would meet your needs?
>>
>> Try:
>>
>> '=============>>
>> Private Sub Worksheet_BeforeDoubleClick _
>> (ByVal Target As Range, Cancel As Boolean)
>> Target.Interior.ColorIndex = 6 '<<== CHANGE
>> End Sub
>> '<<=============
>>
>> This is worksheet event code and should be pasted into the worksheets's
>> code
>> module (not a standard module and not the workbook's ThisWorkbook
>> module):
>>
>> Right-click the worksheet's tab
>> Select 'View Code' from the menu and paste the code.
>> Alt-F11 to return to Excel.
>>
>>
>> ---
>> Regards,
>> Norman
>>
>>
>> "Newbie" <[email protected]> wrote in message
>> news:[email protected]...
>> > is there a simple way to color a cell with a right click (excel2003) ?
>>
>>
>>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks