View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Double-click event for cells?

If someone double-clicks on any cell, how can I determine the row number of
that cell and possibly change the color of the first (leftmost) cell of that
row?

For example, if someone double clicks on cell J2, then I want to change the
color of cell A2 to color blue.

-Robert


You could use the Worksheet_BeforeDoubleClick event for that worksheet -OR- the
Workbook_SheetBeforeDoubleClick event in ThisWorkbook.

ActiveSheet.Cells(Target.Row, 1).Interior.Color = vbBlue

To remove:

ActiveSheet.Cells(Target.Row, 1).Interior.ColorIndex = xlNone

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion