ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Double-click event for cells? (https://www.excelbanter.com/excel-programming/454464-double-click-event-cells.html)

RG III

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

GS[_6_]

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


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com