Cannot set ColumnWidth past column 148

M

MNTye

I have a spreadsheet with 198 columns built by VBA procedures. Columns 7
thru 198 contain monthly data, i.e., columns 7 thru 18 contain data for
the months of year 1, columns 19 thru 30 contain data for the months of
year 2, ...., columns 187 thru 198 contain data for the months of year
16.

I need to set the ColumnWidth for columns 7 thru 198 to 4. I've never
had a problem setting ColumnWidth before as I do this (among other
things) for a living for the past 8 months. I've tried multiple
methods, i.e., Range, Range-by-Range, Column-by-Column, and each one
fails at column 149.


Code:
 
C

Charlie

why so complex? Can't you just do

Range(Cells(1, 7), Cells(1, 198)).ColumnWidth = 4

Are some of the cells locked and protected?
 
M

MNTye

No, the cells are neither locked nor protected. I tried setting th
columnwidth for the entire range as my first attempt. That failed so
switched to column by column to see where the problem is. The odd thin
is that even if I start at any column greater than 148, it fails. So i
doesn't appear to be a limit on how many columns can have thei
columnwidth set
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top