ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Determining the current row and col (https://www.excelbanter.com/excel-discussion-misc-queries/57258-determining-current-row-col.html)

k483

Determining the current row and col
 

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

Thanks


k483


--
k483
------------------------------------------------------------------------
k483's Profile: http://www.excelforum.com/member.php...o&userid=10791
View this thread: http://www.excelforum.com/showthread...hreadid=488215


JE McGimpsey

Determining the current row and col
 
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.

In article ,
k483 wrote:

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


Gary''s Student

Determining the current row and col
 
Sub Macro1()
i = Selection.Row
j = Selection.Column
MsgBox (i)
MsgBox (j)
End Sub

If you have Selected a single cell
--
Gary's Student


"k483" wrote:


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

Thanks


k483


--
k483
------------------------------------------------------------------------
k483's Profile: http://www.excelforum.com/member.php...o&userid=10791
View this thread: http://www.excelforum.com/showthread...hreadid=488215




All times are GMT +1. The time now is 04:52 AM.

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