Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To change the column width of column "A", the following code
will work: Columns("A:A").ColumnWidth = 1.57 Is it possible to reference each column with a numerical index? Rather than using "A:A"? I was hoping that the following code would work, but it doesn't: Columns(1,1).ColumnWidth = 1.57 ' wrong |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Robert,
Am Sat, 4 Apr 2015 02:36:09 -0700 schrieb Robert Crandal: Is it possible to reference each column with a numerical index? Rather than using "A:A"? try: Columns(1).ColumnWidth = 1.57 Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi again,
Am Sat, 4 Apr 2015 11:43:58 +0200 schrieb Claus Busch: Rather than using "A:A"? it is not necessary to write Columns("A:A") Columns("A").columnwidth = 1.57 works also Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Claus Busch" wrote:
Rather than using "A:A"? it is not necessary to write Columns("A:A") Columns("A").columnwidth = 1.57 works also Thanks again Claus. BTW, I didn't want to use "A:A" or "A" because I am using a for-next loop to change the width of multiple columns. It just seemed easier with numerical references. My code looks like this: for i = 1 to 40 Columns(i).ColumnWidth = 1.57 next |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Robert,
Am Sat, 4 Apr 2015 03:04:01 -0700 schrieb Robert Crandal: BTW, I didn't want to use "A:A" or "A" because I am using a for-next loop to change the width of multiple columns. It just seemed easier with numerical references. you don't have to loop through the columns. You can do it for a whole range: Range("A1:AN1").ColumnWidth = 1.57 or: ActiveSheet.UsedRange.ColumnWidth = 1.57 Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Claus Busch" wrote:
you don't have to loop through the columns. You can do it for a whole range: Range("A1:AN1").ColumnWidth = 1.57 or: ActiveSheet.UsedRange.ColumnWidth = 1.57 Ah, even better! Thanks again. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why can't i change column width? | Excel Discussion (Misc queries) | |||
Change Cell Width WITHOUT changing Column width | Excel Discussion (Misc queries) | |||
Change the column width | Excel Discussion (Misc queries) | |||
change column width | Excel Discussion (Misc queries) | |||
Change the width of a single column in a column chart | Charts and Charting in Excel |