Find x-y coordinates of cell?

  • Thread starter Thread starter Sun Tzu
  • Start date Start date
S

Sun Tzu

How can I find the x-y coordinates of the upper-left corner of a cell?

I want to insert two overlapping rectangles (msoShapeRectangle) of
different colors into the cell to illustrate the percentage value
displayed in an adjacent cell. Row heights an column widths on the
sheet are not predictable.

Thanks,
Wes
 
Sub whereAmI()
MsgBox (ActiveCell.Top & Chr(10) & ActiveCell.Left)
End Sub


Note that if you select A1 you get 0,0

So it is relative to the top of the shorksheet, not the top of the
application.
 
Sub whereAmI()
MsgBox (ActiveCell.Top & Chr(10) & ActiveCell.Left)
End Sub

Note that if you select A1 you get 0,0

So it is relative to the top of the shorksheet, not the top of the
application.
--
Gary''s Student - gsnu2007i







- Show quoted text -

Thank you!
 

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