View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Find x-y coordinates of cell?

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


"Sun Tzu" wrote:

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