'Writing To A Range Using VBA array
I have a script that pulls the first cell value of a table from a database and adds it 10 times. I want to write that list to excel.
Here's what I have so far:
sub x()
Dim myArray As Variant
Dim i As Variant
myArray = Sheets("License Plate Number").Range("LP")
myVariable = (Trim(Right(mp_start, 12)))
For i = 0 To (ord_qty / 120) - 1
Myarr = "MP" & myVariable + i
myArray = Myarr
'MsgBox Myarr
Debug.Print Myarr
Next i
end sub
How can I write to a range using VBA?
Solution 1:[1]
It's very simple. You just do it like this.
Range("A1:J1")=Myarr
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | braX |