Originally Posted by
wjones
Yes, that is the concept. I just need to digest it and use it in my code!
Is it possible to use 'Cells' instead of [range].resize?
e.g. [a1].resize to cells(1,1).resize
Thank you for your help!
YES
In fact I would normally use "cells(1,1)", but decided to use the [a1] format as that was what you seemed to have used
The code altered would be:
Sub test()
Dim MyArray
'quick method to create an array to test with
MyArray = Range(Cells(1,1), Cells(4,3))
'Extract row 1 of the array into a row of cells starting at E1
Cells(1,5).Resize(1, UBound(MyArray, 2) - LBound(MyArray, 2) + 1) = WorksheetFunction.Index(MyArray, 1, 0)
'Extract column 2 of the array into a column of cells starting at E3
Cells(3,5).Resize(UBound(MyArray, 1) - LBound(MyArray, 1) + 1, 1) = WorksheetFunction.Index(MyArray, 0, 2)
End Sub
Bookmarks