View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leo Heuser[_2_] Leo Heuser[_2_] is offline
external usenet poster
 
Posts: 111
Default Index of Cells in a selection

Hello Rod

Here's one way:

Sub FindIndex()
'Leo Heuser, 14 Nov. 2003
Dim Cell As Range

For Each Cell In Selection.Cells
If Cell.Address = ActiveCell.Address Then
MsgBox "Index = " & Cell.Row - Selection.Row + 1 _
& ", " & Cell.Column - Selection.Column + 1
Exit For
End If
Next Cell

End Sub


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Rod" skrev i en meddelelse
...

Hello, everyone!

I am trying to write code to determine the index of the "active" cell in a

selection of say, two cells. Can you direct me to the way of learning how
to go about that?

I appreciate your time,

Rod