I am trying to pull data from a source array into a target array by searching based on two criteria. The source array is 9x35,000 and the target array is 250x200. Each "row" in the source array only contains one entry for the target array and could be deleted or eliminated from the loop if I knew an efficient way to delete rows in the source array once the data has been pulled from them. See code below:
For i = 1 To coUnt 'coUnt=150
For j = 1 To naMes 'naMes=250
For ii = 1 To lastRow 'lastRow=35,000
If targetArray(j + 1, dataCol1) & targetArray(1, dataCol2+i) = sourceArray(ii, dataCol3) & sourceArray(ii, dataCol4) Then
targetArray(j + 1, dataCol2 + i) = sourceArray(ii, dataCol5)
GoTo cont2:
End If
Next ii
cont2:
Next j
Next i
I need to shorten the execution time by a factor of 10. Any applicable suggestions appreciated. Thanks!
For i = 1 To coUnt 'coUnt=150
For j = 1 To naMes 'naMes=250
For ii = 1 To lastRow 'lastRow=35,000
If targetArray(j + 1, dataCol1) & targetArray(1, dataCol2+i) = sourceArray(ii, dataCol3) & sourceArray(ii, dataCol4) Then
targetArray(j + 1, dataCol2 + i) = sourceArray(ii, dataCol5)
GoTo cont2:
End If
Next ii
cont2:
Next j
Next i
I need to shorten the execution time by a factor of 10. Any applicable suggestions appreciated. Thanks!