how to know the column/row of a selected cell in vba?

  • Thread starter Thread starter daryl
  • Start date Start date
D

daryl

How can i determine in VBA the rows OR column (not the address) of
selected cell?

if the selected cell is J20, i want to have a separate value assigne
for x_col = 10 and y_row = 20

thank you for the hel
 
x_col = Selection.cells(1).colum
y_row = Selection.cells(1).ro


----- daryl > wrote: ----

How can i determine in VBA the rows OR column (not the address) of
selected cell

if the selected cell is J20, i want to have a separate value assigne
for x_col = 10 and y_row = 2

thank you for the hel
 
I have a question relating to the original post: How do you change
the active cell using VBA? In other words if the cellpointer is in
G10, how can I move it to G11?
 
One way:

Range("G11").Activate

another:

ActiveCell.Offset(1, 0). Activate

A third:

ActiveCell(2, 1).Activate
 

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

Back
Top