View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jfcby jfcby is offline
external usenet poster
 
Posts: 33
Default Store data in array

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