Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default highlight with right click?

is there a simple way to color a cell with a right click (excel2003) ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default highlight with right click?

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" wrote in message
...
is there a simple way to color a cell with a right click (excel2003) ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default highlight with right click?

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" wrote in message
...
is there a simple way to color a cell with a right click (excel2003) ?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default highlight with right click?

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" wrote in message
...
is there a simple way to color a cell with a right click (excel2003) ?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default highlight with right click?

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" wrote in message
...
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" wrote in message
...
is there a simple way to color a cell with a right click (excel2003) ?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to highlight more related cells if cell highlight Jon Excel Discussion (Misc queries) 5 December 21st 08 01:06 PM
click on one cell to find and highlight a related cell? JustSomeGuy Excel Discussion (Misc queries) 1 September 3rd 07 03:02 PM
Disabling click and right-click on the Picture I inserted in an Excel document [email protected] Excel Worksheet Functions 1 June 2nd 06 09:13 PM
Click on graph bar to execute a double-click in a pivot table cell [email protected] Charts and Charting in Excel 4 August 3rd 05 01:37 AM
Highlight cells with ctrl-click but only un-highlight one cell hagan Excel Discussion (Misc queries) 5 May 27th 05 06:45 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"