Thread: Textbox margin
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Textbox margin

Try it this way:

Sub ABCD()
Dim shp As Shape
Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
20#, 20#, 67.5, 46.5)
With shp.TextFrame
.AutoMargins = False
.MarginLeft = 0
.MarginRight = 0
.MarginBottom = 0
.MarginTop = 0
.Characters.Text = "ABCD EFGH IJKL MNOP"
End With
End Sub
--
Regards,
Tom Ogilvy


"Linda Edlund" wrote:

I have too questions:
1) VBA code
Selection.ShapeRange.TextFrame.MarginLeft = 0#
Selection.ShapeRange.TextFrame.MarginRight = 0#
Selection.ShapeRange.TextFrame.MarginTop = 0#
Selection.ShapeRange.TextFrame.MarginBottom = 0#
seems to don't work. I have to click off <inside Margin <checkbox
Automatic manually to get it in function

2) What is difference between
Selection.ShapeRange.TextFrame.MarginLeft = 0#
or
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 405#, 195#, 67.5,
46.5).Select
And
Selection.ShapeRange.TextFrame.MarginLeft = 0
or
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 405, 195, 67.5, 46.5).Select

Any assistance would be greatly appreciated.