Hello, I have this code ...
but when the result I get printed back is only the first position of the array... for example..
if the first value in the array is AAA... the entire range will have just AAA printed back.. and not the actual values..
I can see the whole array successfully calculated in the watch window.. but the return to range bit is bugging out...
any tips?
VBA Code:
Sub Pivot_Replace()
Dim wb As Workbook: Set wb = ThisWorkbook
Dim ws As Worksheet: Set ws = wb.Worksheets("Batch Processing & Hold List")
Dim salesList As Worksheet: Set salesList = wb.Worksheets("Sales List Import")
Dim lr As Long, i As Long, j As Long, a As Variant, cancel() As Variant
lr = salesList .Cells(salesList .Rows.Count, 1).End(3).Row
a = salesList.Range("A2:R" & lr).Value
ReDim cancel(1 To lr) As Variant
For i = LBound(a) To UBound(a)
If a(i, 9) <> Empty Then
j = j + 1
cancel(j) = a(i, 3)
End If
Next i
ws.Range("T7").Resize(UBound(cancel)).Value = cancel
End Sub
but when the result I get printed back is only the first position of the array... for example..
if the first value in the array is AAA... the entire range will have just AAA printed back.. and not the actual values..
I can see the whole array successfully calculated in the watch window.. but the return to range bit is bugging out...
any tips?