+ Reply to Thread
Results 1 to 2 of 2

Text alignment in a cell from VBA

  1. #1
    Registered User
    Join Date
    03-27-2006
    Posts
    70

    Text alignment in a cell from VBA

    This one has me confused.
    Not expecting it to work, I threw the following line intoa module:

    Please Login or Register  to view this content.
    Surprisingly it worked, centering the text in the cell or block of cells.

    I did a number of modifications to the code today, but nothing that I would think have any impact on that whatsoever, but now I am getting the error statement I originally expected to the effect of "This object does not support that property or method."

    Other than voodoo, can anyone suggest what might be going on?

  2. #2
    Tom Ogilvy
    Guest

    RE: Text alignment in a cell from VBA

    The range object doesn't have an alignment property, so it is highly doubtful
    that the command that was actually executed is the command you show if in
    fact the text in a cell was centered.

    the alignment property and this constant belong to a wordart object. This
    is in a totally different library than Excel.

    --
    Regards,
    Tom Ogilvy


    "brucemc" wrote:

    >
    > This one has me confused.
    > Not expecting it to work, I threw the following line intoa module:
    >
    >
    > Code:
    > --------------------
    > .Range("F16").Alignment = msoTextEffectAlignmentCentered
    > --------------------
    >
    >
    > Surprisingly it worked, centering the text in the cell or block of
    > cells.
    >
    > I did a number of modifications to the code today, but nothing that I
    > would think have any impact on that whatsoever, but now I am getting
    > the error statement I originally expected to the effect of "This object
    > does not support that property or method."
    >
    > Other than voodoo, can anyone suggest what might be going on?
    >
    >
    > --
    > brucemc
    > ------------------------------------------------------------------------
    > brucemc's Profile: http://www.excelforum.com/member.php...o&userid=32871
    > View this thread: http://www.excelforum.com/showthread...hreadid=558995
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1