Determining the current row and col

K

k483

What's the VB syntax for determining the current row and current co
prior to a DoubleClick?

Thanks


k48
 
J

JE McGimpsey

If you mean the cell in which the double click occurred, then one way:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With Target
MsgBox "Address: " & .Address & vbNewLine & _
"Row: " & .Row & vbNewLine & _
"Column: " & .Column
End With
End Sub

Put the code in the Worksheet code module.
 
G

Gary''s Student

Sub Macro1()
i = Selection.Row
j = Selection.Column
MsgBox (i)
MsgBox (j)
End Sub

If you have Selected a single cell
 
Top