Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jess, give this code a try. It will add a text box like shape to the active
sheet, insert some text, and right-align the text. Troy Sub AddTextBoxShape() Dim shp As Excel.Shape Set shp = ActiveSheet.Shapes.AddTextBox( _ msoTextOrientationHorizontal, _ 281, 23.75, 260, 25) With shp.TextFrame .Characters.Text = "Hello, I'm right aligned" .HorizontalAlignment = xlHAlignRight End With Set shp = Nothing End Sub "Jess" wrote in message ... When creating a form for Excel 2000, I realized that I need the actual vba code for right-aligning text in a text box. I know how to do this using the properties of the textbox, but for the sake of fault tolerance (users deleting textbox by accident) and because it is wrapped in a macro, I need code to do this. This is what I currently have: ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 281, 23.75, _ 260, 25).Select Selection.????????? Any suggestions are welcome and greatly appreciated! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
align text?? | New Users to Excel | |||
Align text in Excel? | Excel Discussion (Misc queries) | |||
How to align text boxes? | Excel Discussion (Misc queries) | |||
Code works in XL2000 but not in XP!? | Excel Programming | |||
XL2000 VBA code to ACCESS 2000 | Excel Programming |