frank_m
11-29-2011, 01:56 AM
I have 30 columns, all with Headers, but it often varies as to how many are using the autofilter.
How might I create an Array from 1 to the last column in the Autofilter range
Dim ArrCols As Variant
Dim LastFiltCol As Integer
LastFiltCol = AutoFilter.Range.Columns.Count
'For example, if there are 7 columns in the Autofilter range, I want the equivilant to:
'ArrCols = Array(1, 2, 3, 4, 5, 6, 7)
'Wrong of course but hopefully something similar to:
ArrCols = Array(1, LastFiltCol)
Thanks
How might I create an Array from 1 to the last column in the Autofilter range
Dim ArrCols As Variant
Dim LastFiltCol As Integer
LastFiltCol = AutoFilter.Range.Columns.Count
'For example, if there are 7 columns in the Autofilter range, I want the equivilant to:
'ArrCols = Array(1, 2, 3, 4, 5, 6, 7)
'Wrong of course but hopefully something similar to:
ArrCols = Array(1, LastFiltCol)
Thanks