How to detect row number of selected cells?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

I have to write a macro which allows user to highlight some consecutive
cells in column A, then the user click a button on the worksheet to call a
macro program and the program can detect the row numbers which cells are
highlighted. Seems hard?! The cells selected can be different each time.....
Can anyone advise? Thanks a million in advance.

Ivan
 
One way:

Public Sub WhichRows()
MsgBox "Rows " & Selection.EntireRow.Address(False, False, xlA1)
End Sub
 
Back
Top