Hi Experts,
I am trying to add a callout shape thru VBA. Below is the code which I have with the help of macro recorder, but it is not showing the text in the shape.
Someone please look into it and it will be great if you tied up this code a bit.
I am trying to add a callout shape thru VBA. Below is the code which I have with the help of macro recorder, but it is not showing the text in the shape.
Someone please look into it and it will be great if you tied up this code a bit.
Code:
Sub AddCallOut()
'
' Macro1 Macro
'
'
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangularCallout, Left:=ActiveCell.Left, Top:=ActiveCell.Top, Width:=50, Height:=50).Select
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 255, 0)
.Transparency = 0
.Solid
End With
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(204, 204, 0)
.Transparency = 0
End With
With Selection.ShapeRange.TextFrame2.TextRange.Characters.Text = "TEXT"
End With
With Selection.ShapeRange.TextFrame2.TextRange.Characters.Font
.Name = "+mn-cs"
.Size = 10
.Bold = msoTrue
.Fill.ForeColor.RGB = RGB(0, 0, 0)
End With
End Sub