Hi Gary, thanks for the reply that is what i had in mind. Could you help me
by showing me how one would do that Please.
Thanks in advance,
> don't know which columns, if they're consecutive or not, but you could possibly
> use an array to store the widths.
[quoted text clipped - 5 lines]
> >
> > Any help would be greatly appreciated
maybe something like this. this would set the width for the first 10 columns.
the option base 1 set the 1st element position to 1 instead of 0.
if you only had option explicit at the top, you have to use this line instead:
ws.Columns(i).ColumnWidth = arr(i - 1)
Option Base 1
Sub new_column_width()
Dim i As Long
Dim arr As Variant
Dim ws As Worksheet
arr = Array("25", "12", "8", "13", "9", "9", "12", "10", "12", "20")
Set ws = Worksheets("Sheet1")
For i = 1 To 10
ws.Columns(i).ColumnWidth = arr(i)
Next
End Sub

Signature
Gary
> Hi Gary, thanks for the reply that is what i had in mind. Could you help me
> by showing me how one would do that Please.
[quoted text clipped - 11 lines]
>> >
>> > Any help would be greatly appreciated
Les - 16 Nov 2007 06:51 GMT
Thank you so much Gary.
In your opinion is this the best way to handle this ?

Signature
Les
> maybe something like this. this would set the width for the first 10 columns.
> the option base 1 set the 1st element position to 1 instead of 0.
[quoted text clipped - 31 lines]
> >> >
> >> > Any help would be greatly appreciated
Gary Keramidas - 16 Nov 2007 06:58 GMT
i'm not qualified to answer that one. i know i've used this method before. maybe
someone who knows more than me will have an opinion.

Signature
Gary
> Thank you so much Gary.
> In your opinion is this the best way to handle this ?
[quoted text clipped - 37 lines]
>> >> >
>> >> > Any help would be greatly appreciated
carlo - 16 Nov 2007 08:29 GMT
Hi Les
you are talking about "the widhts are variable" but then you try to
use fixed widhts which are stored in an array.
Just to clarify the situation: Do those 51 Lines all have fixed widths
but all different widths, or do those widths vary depending on the
data?
in case 1)
you can use Garys answer
in case 2)
you should try the Autofit approach of Mike
Any other questions, just ask.
hth
Carlo