+ Reply to Thread
Results 1 to 6 of 6

Center Align

Hybrid View

  1. #1
    John 3:16
    Guest

    Center Align

    Hello,

    I know that using
    xlBook.Worksheets(5).Range("C25..B27").Font.Bold = True
    will set the cell attribute for the given range to Bold.

    How do I set the alignment to "Center, left or right"

    thanks in advance,
    bob mcclellan



  2. #2
    Bill
    Guest

    Re: Center Align

    Exampe:

    cells(1,1) .HorizontalAlignment = xlRight
    cells(1,1).VerticalAlignment = xlRight

    Can use xlTop, xlBottom, xlRight, xlLeft



    "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    news:Oomq8Ht5FHA.3388@TK2MSFTNGP11.phx.gbl...
    > Hello,
    >
    > I know that using
    > xlBook.Worksheets(5).Range("C25..B27").Font.Bold = True
    > will set the cell attribute for the given range to Bold.
    >
    > How do I set the alignment to "Center, left or right"
    >
    > thanks in advance,
    > bob mcclellan
    >




  3. #3
    John 3:16
    Guest

    Re: Center Align

    Thanks for the reply Bill.
    I tried this:
    xlBook.Worksheets(5).Range("b25..b27").cells.HorizontalAlignment = xlCenter
    This, and other variations I've tried... does not work.
    what should the correct syntax be?

    thanks in advance,
    bob.

    "Bill" <bill@bpiconsulting.com> wrote in message
    news:NL2df.7853$AS6.6211@newsread3.news.atl.earthlink.net...
    > Exampe:
    >
    > cells(1,1) .HorizontalAlignment = xlRight
    > cells(1,1).VerticalAlignment = xlRight
    >
    > Can use xlTop, xlBottom, xlRight, xlLeft
    >
    >
    >
    > "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    > news:Oomq8Ht5FHA.3388@TK2MSFTNGP11.phx.gbl...
    >> Hello,
    >>
    >> I know that using
    >> xlBook.Worksheets(5).Range("C25..B27").Font.Bold = True
    >> will set the cell attribute for the given range to Bold.
    >>
    >> How do I set the alignment to "Center, left or right"
    >>
    >> thanks in advance,
    >> bob mcclellan
    >>

    >
    >




  4. #4
    Gary Keramidas
    Guest

    Re: Center Align

    give this a try

    With Worksheets(5).Range("b25..b27")
    ..HorizontalAlignment = xlCenter
    End With

    --


    Gary


    "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    news:ed%23Xnat5FHA.4012@TK2MSFTNGP14.phx.gbl...
    > Thanks for the reply Bill.
    > I tried this:
    > xlBook.Worksheets(5).Range("b25..b27").cells.HorizontalAlignment =
    > xlCenter
    > This, and other variations I've tried... does not work.
    > what should the correct syntax be?
    >
    > thanks in advance,
    > bob.
    >
    > "Bill" <bill@bpiconsulting.com> wrote in message
    > news:NL2df.7853$AS6.6211@newsread3.news.atl.earthlink.net...
    >> Exampe:
    >>
    >> cells(1,1) .HorizontalAlignment = xlRight
    >> cells(1,1).VerticalAlignment = xlRight
    >>
    >> Can use xlTop, xlBottom, xlRight, xlLeft
    >>
    >>
    >>
    >> "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    >> news:Oomq8Ht5FHA.3388@TK2MSFTNGP11.phx.gbl...
    >>> Hello,
    >>>
    >>> I know that using
    >>> xlBook.Worksheets(5).Range("C25..B27").Font.Bold = True
    >>> will set the cell attribute for the given range to Bold.
    >>>
    >>> How do I set the alignment to "Center, left or right"
    >>>
    >>> thanks in advance,
    >>> bob mcclellan
    >>>

    >>
    >>

    >
    >




  5. #5
    John 3:16
    Guest

    Re: Center Align

    Thanks for the reply Gary.

    This did not work either.
    The error message I receive from the DTS Package is:

    Error Source: Microsoft Data Transformation Services(DTS) Package
    Error Description: Error Code: 0
    Error Source: Microsoft Excel
    Error Description: Unable to set the HorizontalAlignment property of the
    Range Class
    Error on line 53

    Not sure why this will not take this syntax.
    I used it exactly as per your advice.

    thanks in advance,
    bob.

    "Gary Keramidas" <GKeramidasATmsn.com> wrote in message
    news:%239Z$nnt5FHA.1276@TK2MSFTNGP10.phx.gbl...
    > give this a try
    >
    > With Worksheets(5).Range("b25..b27")
    > .HorizontalAlignment = xlCenter
    > End With
    >
    > --
    >
    >
    > Gary
    >
    >
    > "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    > news:ed%23Xnat5FHA.4012@TK2MSFTNGP14.phx.gbl...
    >> Thanks for the reply Bill.
    >> I tried this:
    >> xlBook.Worksheets(5).Range("b25..b27").cells.HorizontalAlignment =
    >> xlCenter
    >> This, and other variations I've tried... does not work.
    >> what should the correct syntax be?
    >>
    >> thanks in advance,
    >> bob.
    >>
    >> "Bill" <bill@bpiconsulting.com> wrote in message
    >> news:NL2df.7853$AS6.6211@newsread3.news.atl.earthlink.net...
    >>> Exampe:
    >>>
    >>> cells(1,1) .HorizontalAlignment = xlRight
    >>> cells(1,1).VerticalAlignment = xlRight
    >>>
    >>> Can use xlTop, xlBottom, xlRight, xlLeft
    >>>
    >>>
    >>>
    >>> "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    >>> news:Oomq8Ht5FHA.3388@TK2MSFTNGP11.phx.gbl...
    >>>> Hello,
    >>>>
    >>>> I know that using
    >>>> xlBook.Worksheets(5).Range("C25..B27").Font.Bold = True
    >>>> will set the cell attribute for the given range to Bold.
    >>>>
    >>>> How do I set the alignment to "Center, left or right"
    >>>>
    >>>> thanks in advance,
    >>>> bob mcclellan
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




  6. #6
    John 3:16
    Guest

    Re: Center Align

    If anyone is interested...
    this was the solution...

    ..HorizontalAlignment = -4108 ' Center
    bob.


    "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    news:eY1z7st5FHA.3136@TK2MSFTNGP09.phx.gbl...
    > Thanks for the reply Gary.
    >
    > This did not work either.
    > The error message I receive from the DTS Package is:
    >
    > Error Source: Microsoft Data Transformation Services(DTS) Package
    > Error Description: Error Code: 0
    > Error Source: Microsoft Excel
    > Error Description: Unable to set the HorizontalAlignment property of the
    > Range Class
    > Error on line 53
    >
    > Not sure why this will not take this syntax.
    > I used it exactly as per your advice.
    >
    > thanks in advance,
    > bob.
    >
    > "Gary Keramidas" <GKeramidasATmsn.com> wrote in message
    > news:%239Z$nnt5FHA.1276@TK2MSFTNGP10.phx.gbl...
    >> give this a try
    >>
    >> With Worksheets(5).Range("b25..b27")
    >> .HorizontalAlignment = xlCenter
    >> End With
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >> "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    >> news:ed%23Xnat5FHA.4012@TK2MSFTNGP14.phx.gbl...
    >>> Thanks for the reply Bill.
    >>> I tried this:
    >>> xlBook.Worksheets(5).Range("b25..b27").cells.HorizontalAlignment =
    >>> xlCenter
    >>> This, and other variations I've tried... does not work.
    >>> what should the correct syntax be?
    >>>
    >>> thanks in advance,
    >>> bob.
    >>>
    >>> "Bill" <bill@bpiconsulting.com> wrote in message
    >>> news:NL2df.7853$AS6.6211@newsread3.news.atl.earthlink.net...
    >>>> Exampe:
    >>>>
    >>>> cells(1,1) .HorizontalAlignment = xlRight
    >>>> cells(1,1).VerticalAlignment = xlRight
    >>>>
    >>>> Can use xlTop, xlBottom, xlRight, xlLeft
    >>>>
    >>>>
    >>>>
    >>>> "John 3:16" <bobmcc@tricoequipment.com> wrote in message
    >>>> news:Oomq8Ht5FHA.3388@TK2MSFTNGP11.phx.gbl...
    >>>>> Hello,
    >>>>>
    >>>>> I know that using
    >>>>> xlBook.Worksheets(5).Range("C25..B27").Font.Bold = True
    >>>>> will set the cell attribute for the given range to Bold.
    >>>>>
    >>>>> How do I set the alignment to "Center, left or right"
    >>>>>
    >>>>> thanks in advance,
    >>>>> bob mcclellan
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >




+ 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