tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,913
- Office Version
- 365
- 2019
- Platform
- Windows
If I want to return the values of an array to the worksheet, I write:
But what if my array is "not normal"?
My data is as follows:
I wrote the following to split it:
If I try:
it no longer works.
It's because NameArray looks like this in the Locals Window:
How can I return the values of NameArray to the worksheet?
Thanks
Code:
Sheet1.Cells(1,1).Resize(10,20).Value = MyArray()
But what if my array is "not normal"?
My data is as follows:
Code:
Name1-LastName1
Name2-LastName2
I wrote the following to split it:
Code:
Dim DataArray() As Variant
DataArray() = Cells(1, 1).CurrentRegion.Value
For Counter = 1 To 2
NameArray(Counter, 1) = Split(DataArray(Counter, 1), "-")
Next Counter
If I try:
Code:
Sheet2.Cells(1, 1).Resize(2,1).Value = NameArray()
it no longer works.
It's because NameArray looks like this in the Locals Window:
Code:
NameArray(1)
NameArray(1,1)
NameArray(1,1)(0)
NameArray(2,1)(1)
How can I return the values of NameArray to the worksheet?
Thanks