Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How do I set text alignment in code.

The help files for programming in excel are ridiculously atrocious. It's way
too hard to find what you are looking for.

What I want to know is how do I set the alignment (justification) of text in
a cell using vb code?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default How do I set text alignment in code.

The "best" Excel help exists in XL 97. It responds much quicker and gives you "mush"
when you enter mush not "soup". I have/use three versions of XL, but use the XL 97
help for all of them. From that help file...

"HorizontalAlignment Property"
Returns or sets the horizontal alignment for the object. Read/write Long

For all objects, this can be one of the following XlHAlign constants:
xlHAlignCenter, xlHAlignDistributed, xlHAlignJustify, xlHAlignLeft, or xlHAlignRight.

In addition, for the Range or Style object, this property can be set to:
xlHAlignCenterAcrossSelection, xlHAlignFill, or xlHAlignGeneral.

This example left aligns the range A1:A5 on Sheet1...
Worksheets("Sheet1").Range("A1:A5").HorizontalAlig nment = xlLeft
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Patch61"
wrote in message
The help files for programming in excel are ridiculously atrocious. It's way
too hard to find what you are looking for.
What I want to know is how do I set the alignment (justification) of text in
a cell using vb code?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How do I set text alignment in code.

found it:
Worksheets("Sheet1").Range("A1:A5").HorizontalAlig nment = xlLeft

"Patch61" wrote:

The help files for programming in excel are ridiculously atrocious. It's way
too hard to find what you are looking for.

What I want to know is how do I set the alignment (justification) of text in
a cell using vb code?


Reply
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
text alignment code k483 Excel Discussion (Misc queries) 1 July 12th 05 04:08 PM


All times are GMT +1. The time now is 12:28 AM.

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"