Re: Vertical alignment issue

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jake Marx (msnews_at_longhead.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 08:40:07 -0700

Hi quartz,

If you do in Excel what you are trying to do in VBA, you'll get the same
results (ie, all cells are left-aligned). If you do each cell separately,
it works. Here's a workaround (it may be slow for large areas, so you may
want to rethink things if you run into performance issues):

    Sub test()
        Dim c As Range

        For Each c In Sheet1.UsedRange
            c.VerticalAlignment = xlCenter
        Next c
    End Sub

-- 
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
quartz wrote:
> I don't know, I never tried it manually. But one would suppose that
> if there are two adjustments (vertical and horizontal) and that they
> can be separately set, then logic would follow that they should be
> capable of individual adjustment.
>
> Why would Microsoft have separate controls if you can't use them? Or
> am I missing something?

Quantcast