Hi,
I got this code for another site.
Can you please help me to put the code to add the current month and year also in the text box which is getting added to excel by the below code?
In this MMM-YY should be coming as the current month and yearPHP Code:
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" ' 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
End Sub
Thanks in advance
Bookmarks