MurdochQuill
Board Regular
- Joined
- Nov 21, 2020
- Messages
- 84
- Office Version
- 365
- Platform
- Windows
Hi,
As title suggests, I'm using an array for data consolidation. I keep erroring when trying to copy columns with any formulas in them... is there any way around this when using this method ?
I would also really like to ignore blanks cells & not bring them into the array.
Any help is appreciated!
As title suggests, I'm using an array for data consolidation. I keep erroring when trying to copy columns with any formulas in them... is there any way around this when using this method ?
I would also really like to ignore blanks cells & not bring them into the array.
VBA Code:
Sub Arraycol()
Application.ScreenUpdating = False
'Loop through worksheets, put the values in column F into arr array
Dim arr(1 To 10000), cnt As Integer, i As Integer
cnt = 0
For Each ws In Worksheets
If ws.Name <> "Stitcher" Then
For i = 1 To ws.Cells(rows.Count, "F").End(xlUp).Row
cnt = cnt + 1
arr(cnt) = ws.Cells(i, "F").Value
Next i
End If
Next ws
'Loop through arr array, populate value into Stitcher sheet, column A
For i = 1 To cnt
ThisWorkbook.Sheets("Stitcher").Cells(i, "A") = arr(i)
Next i
Application.ScreenUpdating = True
End Sub
Any help is appreciated!