I currently have an array full of data that I would like to transfer to cell G2 all the way until the entire array is exhausted. My current spreadsheet has data in G1 but no data under that.
I have the following code but it doesn't exactly work because I get the error:
Application-defined or object-defined error.
Help fixing this problem would be great. I would appreciate if you could tell me what is wrong with my code and how to fix it rather than providing me with an alternative formulation.
For i = 1 to nFlights
With Worksheets("Q2").Range("G1")
.End(xlDown).Offset(1, 0) = Origin(i)
End With
Next
I know you didn't want to be shown code, but here's a different approach from your loop:
Dim arr
arr = Array("one","two","three","four")
ActiveSheet.Range("G2").Resize((UBound(arr) - LBound(arr)) + 1, 1).Value = _
Application.Transpose(arr)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With