How to obtain the number of Column and Row from selected (active)cell?

A

And1

Maybe this stupid, but it will add me in sure project.

For example, select mouse any cell, and
I want, to :

Cells("A1").Value = Row
Cells("A2").Value = Col
' dim Row, Col as Integer
but,
Row = ???? (I don't know)
Col = ???? (I don't know)

Regards,
Andrzej
 
B

Brian

Try

rowId = Range(ActiveCell.Address).Row
colId = Range(ActiveCell.Address).Column
 

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