Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default auto fit & horizontal alignment not working

I have some code that is not centering and formatting all of the columns. I
have coppied the snippet of code that his adjusting the alignment and
autofit. Can anyone tell why the code is not formatting all of the cells?

Columns("A:R").EntireColumn.Select
With Selection.EntireColumn
Cells.EntireColumn.AutoFit
HorizontalAlignment = xlCenter
VerticalAlignment = xlBottom
End With




Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default auto fit & horizontal alignment not working

here's how i'd do it:

Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
With ws.Columns("A:R")
.AutoFit
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With

--

Gary Keramidas
Excel 2003


"petedacook" wrote in message
...
I have some code that is not centering and formatting all of the columns.
I
have coppied the snippet of code that his adjusting the alignment and
autofit. Can anyone tell why the code is not formatting all of the cells?

Columns("A:R").EntireColumn.Select
With Selection.EntireColumn
Cells.EntireColumn.AutoFit
HorizontalAlignment = xlCenter
VerticalAlignment = xlBottom
End With




Thanks!!


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
Horizontal Scroll Bar Not Working DCJoe Excel Worksheet Functions 0 April 9th 09 12:38 AM
what does "horizontal alignment = -4108" mean? Sapna Excel Discussion (Misc queries) 1 January 20th 09 06:45 AM
Horizontal Alignment Philippe Perrault Excel Programming 0 December 23rd 08 07:27 PM
sumproduct w/horizontal range not working dcd123 Excel Worksheet Functions 6 August 22nd 05 11:48 PM
Cells(r, c) syntax and horizontal alignment Neal Zimm Excel Programming 3 January 31st 05 09:01 PM


All times are GMT +1. The time now is 10:25 AM.

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"