View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dom[_4_] Dom[_4_] is offline
external usenet poster
 
Posts: 11
Default alignment of SOME text in a textbox

On Jun 16, 11:17*am, GS wrote:
Dom submitted this idea :





I have several sheets with a text box giving various instructions.
All of the text is left aligned. *But the last line is "Copyright,
2012", and this last line I want right aligned. *Of course, I can do
it through the Excel interface, but when I turn the macro recording
on, I get a blank macro. *Does anyone know the VBA code?


Remember, I need to align only part of the text, not the entire text
box. *I've tried ...


ActiveSheet.Shapes(1).select
Selection.characters(?,?).alignment


... but it doesn't work.


TIA,
Dom


Textbox alignment applies to the entire contents. To implement
indentation you need to 'pad' the line with spaces. What you want to do
here, then, is provide enough padding so the text 'appears' to be
right-aligned.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -


But why then is it possible to right align a single line of text using
the EXCEL interface? That is, I can select the line, hit the right
align button, and it is done. It should be possible to do this in VBA.