View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GTVT06 GTVT06 is offline
external usenet poster
 
Posts: 141
Default How to change column size in VB6 and Excel 2002

On Jan 15, 8:21*pm, Tony Girgenti 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