excel column autofit

John Machin sjmachin at lexicon.net
Tue Jun 12 19:56:00 EDT 2007


On Jun 13, 8:09 am, Lance Hoffmeyer <l... at augustmail.com> wrote:
> Hey all,
>
> Wondering why the syntax won't autofit Column A?
> I am not getting any errors.
>
> Also, is there a way of reducing the number of
> syntax lines?  Basically, I am wondering if there
> is an easier way to copy and paste?
>
> Thanks in Advance.
>
> Lance
>
> # ADD ROW LABELS
> sh = wb.Worksheets ("Total")
> sh.Select()
> sh.Range(sh.Cells(2,1),  sh.Cells(20,1)).Select()
> sh.Range(sh.Cells(2,1),  sh.Cells(20,1)).Copy()
> sh = wb.Worksheets ("Current Total")
> sh.Select()
> sh.Range(sh.Cells(2,1),sh.Cells(20,1)).Select()
> sh.Paste()
> sh.Columns("A:A").EntireColumn.AutoFit

You need () after Autifit.
You need to look up "syntax" in a dictionary.

HTH,
John




More information about the Python-list mailing list