View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Greg Lovern Greg Lovern is offline
external usenet poster
 
Posts: 224
Default Column Width Problem

On Mar 31, 9:33 am, "Gary Keramidas" <GKeramidasATmsn.com wrote:
i'm sure there is a shorter way, but i have used something like this before.

Option Explicit
Sub set_column_widths()
Dim arr() As Double
Dim i As Long
Dim x As Long
Dim z As Long
x = 0
For i = 1 To 26
ReDim Preserve arr(0 To i - 1)
arr(x) = Worksheets("Sheet1").Columns(i).ColumnWidth
x = x + 1
Next

For x = LBound(arr) To UBound(arr)
Worksheets("Sheet2").Columns(x + 1).ColumnWidth = arr(x)
Next
End Sub



Thanks, I tried that but still getthe same problem.

The destination column *does* get set to the same column width
*number* as the source column. The problem is that even though the two
columns then have the same column width *number*, the destination
column is *visually* much narrower than the source column.

(and both are on 100% zoom.)


Even if I manually set the destination column to the same column width
number as the source column, the destination column is still visually
much narrower than the source column.

Both have the same default font in their normal style -- Arial 10 --
which I understand to be the way that column width units are defined.


Thanks,

Greg