VBA Shapes

  • Thread starter Thread starter NPell
  • Start date Start date
N

NPell

Hi all,

Im trying to create a macro to create a shape, based on cell
references.

Creating the shape is fine, but its pulling in the cell values for the
shape size that is proving difficult.
I have the following, which doesnt work, but might give you an idea of
what im trying to achieve.

shpht = Range("K2").Value
shpwd = Range("K3").Value

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 0, 0#, shpwd,
shpht).
Select

Can anybody help?
 
Hi all,

Im trying to create a macro to create a shape, based on cell
references.

Creating the shape is fine, but its pulling in the cell values for the
shape size that is proving difficult.
I have the following, which doesnt work, but might give you an idea of
what im trying to achieve.

    shpht = Range("K2").Value
    shpwd = Range("K3").Value

    ActiveSheet.Shapes.AddShape(msoShapeRectangle, 0, 0#, shpwd,
shpht).
        Select

Can anybody help?

Oh, it does work, its the syntax that was wrong, no underscore to lead
to the Select on the next line.
Sorry all.
 
Back
Top