View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Find x-y coordinates of cell?

Sub test()
Dim rng As Range
Dim shp As Shape

Set rng = Range("B2:D3")
With rng
Set shp = ActiveSheet.Shapes.AddShape( _
msoShapeRectangle, _
.Left, .Top, .Width, .Height)
End With

shp.Fill.ForeColor.SchemeColor = 7 + 6

End Sub

Regards,
Peter T

"Sun Tzu" wrote in message
...
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