I have a named range which has been placed into an array; the array have 10 fixed columns, but any number of rows. The code to this point is:
Dim LD As Long
Dim Rng As Excel.Range
Dim vArray() As Variant
Dim varTOne() As Variant
Dim varTTwo() As Variant
Dim DSheet As Worksheet
Set DSheet = Worksheets("DataSheet")
LD = DSheet.Cells(Rows.count, "A").End(xlUp).row
Set Rng = ThisWorkbook.Worksheets("DataSheet").Range("A5:J" & LD)
vArray = Rng
Two of the columns, A and B say, are used to uniquely identify a certain result, which is in the last column (J). I need to first ensure that the result is indeed in the array (existence) and then extract the result. In order to ensure existence I would like to merge these two columns A and B, which will give me a "unique key" and match this key to a list. This would we quicker than a nested loop though Column A and B! What is the best way to go around this? I managed to split off the two columns like this:
varTOne = Application.Index(vArray, , 1)
varTTwo = Application.Index(vArray, , 2)
But some how cant get them to merge properly using any of How do I Merge two Arrays in VBA? What am I doing wrong here?
Is it possible to merge two columns in an array without some timely loop?