I have the following situation. In cell A1 if I click on the click, I want the number 1 to appear. If I go to A2 and click on the number 2 to appear, I want to be able to have a count but based on the click.
I have the following situation. In cell A1 if I click on the click, I want the number 1 to appear. If I go to A2 and click on the number 2 to appear, I want to be able to have a count but based on the click.
so you want the row number to appear when you click on a cell? Would you settle on getting the row number on a double-click?
It doesn't bother me with a double click
Place this code in your sheet module
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) MsgBox Target.Row End Sub
Maybe try
Dim r As Range Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not r Is Nothing Then r.ClearContents Target(1).Value = Target.Row Set r = Target End Sub
Try this
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Target(1).Value = Target.Row End Sub
thx. you. is working.
Hi,
You could test following
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Target.Column > 1 Then Exit Sub Target = Target.Row Cancel = True End Sub
You are welcome
Thanks for your Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks