How to detect row number of selected cells?

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
 
J

JE McGimpsey

One way:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top