J
jfcby
Hello,
I have a workbook with hidden rows. How can I modify the following
code to store the hidden columns in an array?
<CODE BEGIN>
Sub ArrayStore()
Dim i As Long 'Integer
Dim rng As Range
'1. Find last column with data
Set rng = Cells.Find(What:="*", After:=Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious)
colnum = rng.Column + 1
'2. Store Hidden Columns
Dim hCol()
Dim hColI As Integer
For hColI = 1 To colnum
If Columns(hColI).EntireColumn.Hidden = 0 Then hCol() =
Array(hColI & ",")
Next
For i = LBound(hCol) To UBound(hCol)
MsgBox i & ", " & hCol(i)
Next
End Sub
<CODE END>
Thank you for your help,
jfcby
I have a workbook with hidden rows. How can I modify the following
code to store the hidden columns in an array?
<CODE BEGIN>
Sub ArrayStore()
Dim i As Long 'Integer
Dim rng As Range
'1. Find last column with data
Set rng = Cells.Find(What:="*", After:=Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious)
colnum = rng.Column + 1
'2. Store Hidden Columns
Dim hCol()
Dim hColI As Integer
For hColI = 1 To colnum
If Columns(hColI).EntireColumn.Hidden = 0 Then hCol() =
Array(hColI & ",")
Next
For i = LBound(hCol) To UBound(hCol)
MsgBox i & ", " & hCol(i)
Next
End Sub
<CODE END>
Thank you for your help,
jfcby