LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default alignment of SOME text in a textbox

Dom explained on 6/17/2011 :
On Jun 16, 6:16*pm, "Clif McIrvin" wrote:
"Dom" wrote in message

...
[ ]

I'm using 2007. *Are we talking about the same thing? *By textbox, I
mean the textbox shape, what you get from the INSERT ribbon. *Not the
multiline text box you might see on a form. *Also, you must have an
actual new line, not just text that has wrapped automatically. *For
example, try "This is<CRa new line". *You can make "This is" align
left, and "a new line" align right.

-----------

Using the xl2010 macro recorder, I get this:

* * ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 153,
38.25, 150, _
* * * * 144.75).Select
* * Selection.ShapeRange(1).TextFrame2.TextRange.Chara cters.Text = _
* * * * "This is " & Chr(13) & "A new Line" & Chr(13) & ""
* * With Selection.ShapeRange(1).TextFrame2.TextRange.Chara cters(1, 9).
_
* * * * ParagraphFormat
* * * .FirstLineIndent = 0
* * * .Alignment = msoAlignRight
* * End With

HTH!

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)


Thanks, Cliff, but I'm guessing this only works in 2010, not 2007. I
get an "Object doesn't support this property" error.

Thanks, again, but I think it's a lost cause.

Dom


And so is why I suggested padding the 2nd line so it 'appears'
right-aligned. This has been a long standing workaround in VB for form
controls and so I don't see why it won't work in VBA. Nice to hear,
though, that 2010 has finally evolved to provide built-in capability
for this.<g

One thing I've found interesting is how often things that work in an
earlier version get axed in later versions. I'm speaking primarily
about v10 (xl2002). Though it's usually a case of the reverse scenario
(newer versions having features not available to earlier versions), I
can only conclude that diffs between v10 and v11 (xl2003) in this
regard were actually mistakes left in v10 that were fixed in v11. In
this regard, then, I have to be careful that what I do in xl2002 still
works in later versions. I admit to not checking this as often as I
should and so it's easy to see how folks can be misguided as a result.
(I hope my clients still using xl2002 upgrade soon<bg)

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
text alignment BillCT1984 Excel Discussion (Misc queries) 1 March 1st 10 04:28 PM
In Cell alignment, how do I update the default vertical alignment How to update default cell alignment Setting up and Configuration of Excel 2 February 4th 09 02:25 PM
Text Alignment Ben Excel Discussion (Misc queries) 3 August 20th 07 07:48 PM
Text alignment dkingfish Excel Discussion (Misc queries) 0 January 22nd 07 03:44 PM
Highlight all Text in a Textbox when the textbox is selected RPIJG[_73_] Excel Programming 3 October 28th 05 08:28 PM


All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"