Hi,
I would like to create a 2-dimensional array from two columns that are not next to each other.
This works for when they are next to each other e.g. A,B F,G etc but I would like to have columns D,P for example:
I have looked at disjoint arrays and several other examples but cannot get the code to work at all.
I have also tried to build the range using this variation:
Again I can get this method to work but only if the columns are side by side.
I would like to create a 2-dimensional array from two columns that are not next to each other.
This works for when they are next to each other e.g. A,B F,G etc but I would like to have columns D,P for example:
VBA Code:
lr = .Cells(.Rows.Count, 6).End(xlUp).Row
arr = .Range("F1:G" & lr)
I have looked at disjoint arrays and several other examples but cannot get the code to work at all.
I have also tried to build the range using this variation:
Code:
lr = .Cells(.Rows.Count, 6).End(xlUp).Row
arr = .Range("F1", "H" & lr)
Again I can get this method to work but only if the columns are side by side.