Hello JLGWhiz.
I used the code posted by kounoike in this thread. It works fine except
that it doesn't change the column width. I makes all of the other changes as
far as values and fonts, etc., but not the column width.
Can this really be done?
Thanks,
Tony
"JLGWhiz" wrote:
> What exactly do you have the variable osheet equal to?
> Better yet, is it a variable or a sheet name?
>
> "Tony Girgenti" wrote:
>
> > Hello GTVT06.
> >
> > I'm getting Subscript out of range when i try your code.
> >
> > Thanks,
> > Tony
> >
> > "GTVT06" wrote:
> >
> > > On Jan 15, 8:21 pm, Tony Girgenti <tony(nospam)@lakesideos.com> wrote:
> > > > Hello.
> > > >
> > > > Using VB6.0 and Excel 2002. I'm trying to change the column width of a
> > > > column before saving the workbook. I can do other changes to the worksheet,
> > > > like fonts and values etc., but it won't change the columnwidth.
> > > >
> > > > I tried these statements and none of them work:
> > > > oSheet.Range("A1").Columns.ColumnWidth = 5.75
> > > > oSheet.Range("A1").ColumnWidth = 5.75
> > > > oSheet.Columns("A:A").ColumnWidth = 5.75
> > > >
> > > > oSheet.Columns("A").Select
> > > > Selection.ColumnWidth = 5.75
> > > >
> > > > Does anybody know how to do this?
> > > >
> > > > Any help would be gratefully appreciated.
> > > >
> > > > Thanks,
> > > > Tony
> > >
> > > Try:
> > >
> > > Sheets("oSheet").Columns("A:A").ColumnWidth = 5.75
> > >
|