• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3232
  • Last Modified:

Excel VBA Add shape inside a cell/range


What VBA code would I use to add a shape and position it inside an Excel cell or range

Murray Brown
Murray Brown
1 Solution
try this one.

Sub AddsSHPcellRANGE()

Dim SSLeft As Double
Dim SSTop As Double
Dim SSWidth As Double
Dim SSHeight As Double

Dim SS As Range
Dim shpOval As Shape

Set SS = Range(Selection.Address)  ' change if you want specific cell <-- Range("a1")

SSLeft = SS.Left
SSTop = SS.Top
SSHeight = SS.Height
SSWidth = SS.Width

Set shp = ActiveSheet.Shapes.AddShape(msoShapeOval, SSLeft, SSTop, 10, 10)

End Sub

Open in new window

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now