Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,074
- Office Version
- 2019
- Platform
- Windows
The code below creates a shape (i.e. Message) when I click on another shape (i.e. Shape A) (works fine). However, I get an error when I just select the row shape A is located. How can I run this sub routine by selecting the row Shape A is located?
VBA Code:
Dim r As Range, Cel As Range
Dim LRow As Long
Dim Shp As Shape
Set Shp = ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, 112.5, 112.5, 115, 1)
Set r = ActiveSheet.Shapes(Application.Caller).TopLeftCell
Set Cel = r.Offset(0, 0)
With Shp
.Name = "Callout"
.TextFrame.Characters.Text = r.Offset(0, 0).Comment.Text
.Left = Cel.Left - .Width
.Top = Cel.Offset().Top
.Line.Visible = msoFalse
.TextFrame2.AutoSize = msoAutoSizeShapeToFitText
.OnAction = "DelCallout"
End With