ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Align text in a text box (https://www.excelbanter.com/excel-programming/431123-align-text-text-box.html)

Ana

Align text in a text box
 
Hi;

I have a text box and I want to justified the text using a macro I have the
following code :


ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = ""
With Selection.Font
..Name = "Calibri"
..FontStyle = "Regular"
..Size = 9

End With

and it works but I do not know how to justified the text
Anybody knows??

thank you




Peter T

Align text in a text box
 
Dim shp As Shape
Set shp = ActiveSheet.Shapes("Text Box 1")
shp.TextFrame.HorizontalAlignment = xlJustify

Regards,
Peter T

"Ana" wrote in message
...
Hi;

I have a text box and I want to justified the text using a macro I have
the
following code :


ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = ""
With Selection.Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 9

End With

and it works but I do not know how to justified the text
Anybody knows??

thank you






Ana

Align text in a text box
 
Thank you a lot

"Peter T" wrote:

Dim shp As Shape
Set shp = ActiveSheet.Shapes("Text Box 1")
shp.TextFrame.HorizontalAlignment = xlJustify

Regards,
Peter T

"Ana" wrote in message
...
Hi;

I have a text box and I want to justified the text using a macro I have
the
following code :


ActiveSheet.Shapes("Text Box 1").Select
Selection.Characters.Text = ""
With Selection.Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 9

End With

and it works but I do not know how to justified the text
Anybody knows??

thank you








All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com