Hi, akhileshgs,
Sub add_textbox_VBA()
Dim shp As Shape
Set shp = ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 200, 50) ' add shape
With shp
.TextFrame.Characters.Text = "Uncontrolled. Valide only for MMM-YY: " & _
Format(DateSerial(Year(Date), Month(Date), 1), "MMM-YY") ' add text to display
.Top = Range("e2").Top ' adjust top
.Left = Range("e2").Left 'adjust left
.TextFrame.AutoSize = True ' turn on autosize
.Fill.ForeColor.RGB = RGB(255, 255, 204) 'choose fill color
.Line.Weight = 1 ' adjust width
.Line.ForeColor.RGB = RGB(255, 0, 18) ' choose color
.Line.DashStyle = msoLineSolid 'choose style
End With
Set shp = Nothing
End Sub
Ciao,
Holger
Bookmarks