O
Otto Moehrbach
Excel XP, Win XP
Helping an OP.
I have a range with numerous hidden columns.
The hidden columns are not contiguous.
Columns A:B are always visible.
I want to count the number of visible columns.
Row 4 is the header row, so I want to count the number of visible cells in
Row 4.
I use the following code to give me that count. I get an error on this
line.
The error message is "Unable to get the SpecialCells property of the range
class."
ColCount = Range("A4", Cells(4, Columns.Count).End(xlToLeft)) _
.SpecialCells(xlCellTypeVisible).Count
This seems simple to do. What am I doing wrong? Thanks for your time.
Otto
Helping an OP.
I have a range with numerous hidden columns.
The hidden columns are not contiguous.
Columns A:B are always visible.
I want to count the number of visible columns.
Row 4 is the header row, so I want to count the number of visible cells in
Row 4.
I use the following code to give me that count. I get an error on this
line.
The error message is "Unable to get the SpecialCells property of the range
class."
ColCount = Range("A4", Cells(4, Columns.Count).End(xlToLeft)) _
.SpecialCells(xlCellTypeVisible).Count
This seems simple to do. What am I doing wrong? Thanks for your time.
Otto