Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Resising Columns in vb code.
Hi.
I am trying to resize my columns in Excel through VB6. I have created my excel.appliation object (xl) and created a new workbook. Now I want to use the code: xl.Cells(1, 1).Width = 100, but I get: Unable to set the width property of the Range class. Even when I try xl.Columns(2).Width = 100 I get the same error. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Resising Columns in vb code.
What about:
xl.Columns("A:A").ColumnWidth = 100 (any range) in place of A:A |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Resising Columns in vb code.
Try
ActiveWorkbook.ActiveSheet.Columns("B:B").ColumnWi dth = 100 You can replace ActiveWorkbook and ActiveSheet with other valid WB and WS references if necessary. Regards, Stefi €˛Camper Joe€¯ ezt Ć*rta: Hi. I am trying to resize my columns in Excel through VB6. I have created my excel.appliation object (xl) and created a new workbook. Now I want to use the code: xl.Cells(1, 1).Width = 100, but I get: Unable to set the width property of the Range class. Even when I try xl.Columns(2).Width = 100 I get the same error. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vb code to hide columns | Excel Discussion (Misc queries) | |||
Help with VB code to compare two columns | Excel Programming | |||
Code not hiding columns | Excel Programming | |||
sizing columns in code | Excel Programming | |||
CODE TO ADD TWO COLUMNS BASED ON ANOTHER | Excel Programming |