excel positioning in Points for vba shapes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want to know how to determine where (in Points) to position an autoshape
using vba (without recording a macro).
aparently shapes lines etc use a point system to position themselves using
start x axis, start y axis, end x asis and end y axis.

1. is it possible to view how many point there in in relation to a cell
reference, and
2. is it even possible to figure out the point system without recording a
macro???
 
Kelzina,

Position your shape relative to cells using the Top and Left properties of the range objects. This
example will draw a line from the upper left of B2 to the upper left of H8:

Sub AddLine()
Dim StartCell As Range
Dim EndCell As Range

Set StartCell = Range("B2")
Set EndCell = Range("H8")

ActiveSheet.Shapes.AddLine StartCell.Left, StartCell.Top, EndCell.Left, EndCell.Top

End Sub

HTH,
Bernie
MS Excel MVP
 

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