Thread
:
Cannot set ColumnWidth past column 148
View Single Post
#
6
Posted to microsoft.public.excel.programming
Gary Brown
external usenet poster
Posts: 178
Cannot set ColumnWidth past column 148
This worked fine for me...
'-------------------------------------------------------------------------
Sub Macro1()
Dim col As Integer
Dim Startcolumn As Integer, Endcolumn As Integer
Startcolumn = 7
Endcolumn = 198
col = Startcolumn
For col = Startcolumn To Endcolumn - 1
ActiveSheet.Range(Cells(6, col), Cells(6, col)).ColumnWidth = 4
Next col
End Sub
'-------------------------------------------------------------------------
I'm wondering what your values for Startcolumn and Endcolumn are.
I can't think of any other issues that would cause this to fail.
--
HTH,
Gary Brown
If this post was helpful to you, please select ''YES'' at the bottom of the
post.
"MNTye" wrote:
cols.address = $ES$6
Further testing has also shown that it also fails if I do not set the
columnwidth for columns 7 through 148 and instead start the loop at
column 149!?!
--
MNTye
------------------------------------------------------------------------
MNTye's Profile:
http://www.excelforum.com/member.php...o&userid=36058
View this thread:
http://www.excelforum.com/showthread...hreadid=558448
Reply With Quote
Gary Brown
View Public Profile
Find all posts by Gary Brown