Text alignment in a cell from VBA

  • Thread starter Thread starter brucemc
  • Start date Start date
B

brucemc

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?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top