What's the most optimal way to pull a column from an array.
Right now I'm looping, but this seems opposite of smart. Is there a way I can use Application.Index or something else to get it in one go?
for instance in Worksheet I can write: Index(Array, , Column) or Index(Array, row,) to get the entire column or row respectively
I've tried MyLSAC = Application.Index(Testing, 0, 3) ...............to no avail, any help would be much appreciated
Current Code below
Sub LSACFill()
TestsTaken = Sheet3.Cells(6, 1).End(xlDown)
Distance = Sheet3.Cells(1, 1).End(xlDown).Row
TStart = Val(Sheet5.TestsStart)
TEnd = Val(Sheet5.TestsEnd)
n = TestsTaken - TStart
m = TEnd - TStart
Dim Testing As Variant
Dim MyLSAC() As Variant
Dim LSACSelec() As Long
ReDim LSACSelec(0)
Testing = Sheet3.Cells(7, 3).Resize(TestsTaken, 1)
c = 0
For i = 1 To TestsTaken
MyLSAC(c) = Testing(i, 3)
c = c + 1
Next
c = 0
For i = 0 To m
If Sheet5.TESTS.Selected(i) Then
ReDim Preserve LSACSelec(c)
LSACSelec(c) = MyLSAC(i)
c = c + 1
End If
Next
Sheet5.LSAC.List = LSACSelec
End Sub
Bookmarks