Hello guys,
im trying to filter some data and add it into an array
Once filtering is completed id like to save all the data into an array.
After i run that my array gets filled in with only the 1 row, the header row
BUT if i try to copy paste the selection it copies everything i want to
What am i doing wrong?
im trying to filter some data and add it into an array
Code:
My filtering code is:
If Sheets(sheetName).AutoFilterMode Then Sheets(sheetName).AutoFilter.ShowAllData
lastCol = Cells(1, Columns.Count).End(xlToLeft).Column
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
Set filterRng = Range(Cells(1, 1), Cells(lastRow, lastCol))
filterRng.Select
isItEmpty = IsEmpty(filterRng)
If isItEmpty = False Then filterRng.AutoFilter 5, SKUInQuesion
Code:
Dim FullDataArray() As Variant
Dim selectedRange As Range
lastRow = Cells.Find(what:="*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row
Set selectedRange = Range("A1:Q" + CStr(lastRow)).SpecialCells(xlCellTypeVisible)
FullDataArray = selectedRange.Value
After i run that my array gets filled in with only the 1 row, the header row
BUT if i try to copy paste the selection it copies everything i want to
What am i doing wrong?
Last edited: