I am trying to dump an array to a worksheet directly without looping. This is possible for all data types, except a 'Byte' array. Why is this so?
I want to use Byte array, so as to save memory cost (data often exceeds the 2GB excel limit). While I have worked around this problem by dividing into chunks, I want to understand why a Byte array can't be dumped into a range directly.
edit 1:
The array value is either 0 or 1. And I want the output shown as it is. Using a Boolean array gives it as TRUE or FALSE, which I don't prefer. Any optimized(memory and speed) ways to do this?
Sub ArrayPasting()
Dim byteArray(1 To 3) As Byte
Dim intArray(1 To 3) As Integer
For i = 1 To 3
byteArray(i) = i
intArray(i) = 2 * i
Next i
ActiveSheet.Range(Cells(1, 1), Cells(1, 3)).Value = intArray 'range populated with intArray
ActiveSheet.Range(Cells(2, 1), Cells(2, 3)).Value = byteArray 'error
End Sub