Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Center Align

Exampe:

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

Can use xlTop, xlBottom, xlRight, xlLeft



"John 3:16" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Center Align

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

thanks in advance,
bob.

"Bill" wrote in message
ink.net...
Exampe:

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

Can use xlTop, xlBottom, xlRight, xlLeft



"John 3:16" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Center Align

give this a try

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

--


Gary


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

thanks in advance,
bob.

"Bill" wrote in message
ink.net...
Exampe:

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

Can use xlTop, xlBottom, xlRight, xlLeft



"John 3:16" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
...
give this a try

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

--


Gary


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

thanks in advance,
bob.

"Bill" wrote in message
ink.net...
Exampe:

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

Can use xlTop, xlBottom, xlRight, xlLeft



"John 3:16" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Center Align

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

..HorizontalAlignment = -4108 ' Center
bob.


"John 3:16" wrote in message
...
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
...
give this a try

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

--


Gary


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

thanks in advance,
bob.

"Bill" wrote in message
ink.net...
Exampe:

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

Can use xlTop, xlBottom, xlRight, xlLeft



"John 3:16" wrote in message
...
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
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
Merge and Center and Center Accross Selection Bojingles03 New Users to Excel 3 March 17th 09 07:05 PM
How do I center numbers in a cell, but align by decimal? Juliue Excel Discussion (Misc queries) 2 January 28th 09 11:55 PM
How do I center align a title at top of sheet. vee Excel Worksheet Functions 1 September 20th 06 10:00 PM
What is short-Cut forleft align and Right align? Sandy Excel Discussion (Misc queries) 1 February 24th 05 12:25 PM
align text in the center of a range of cells nikolaosk[_9_] Excel Programming 4 October 19th 03 09:44 AM


All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"