Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50178

[SOLVED] Insert Call out with text

$
0
0
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.

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


Viewing all articles
Browse latest Browse all 50178

Trending Articles