tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,924
- Office Version
- 365
- 2019
- Platform
- Windows
I have values in cells A1 to B2 on Sheet1.
I want to read those values into an array and paste onto Sheet2.
Why is it that this works:
but this fails:
wth the error message:
Thanks
<strike>
</strike>
I want to read those values into an array and paste onto Sheet2.
Why is it that this works:
Rich (BB code):
Dim MyArray() As Variant
MyArray() = Sheet1.Cells(1, 1).CurrentRegion.Value
Sheet2.Cells(1, 1).CurrentRegion.Delete
Sheet2.Cells(1, 1).Resize(UBound(MyArray(), 1), UBound(MyArray(), 2)).Value = MyArray()
but this fails:
Rich (BB code):
Dim MyArray() As Variant
MyArray() = Sheet1.Cells(1, 1).CurrentRegion.Value
With Sheet2.Cells(1, 1)
.CurrentRegion.Delete
.Resize(UBound(MyArray(), 1), UBound(MyArray(), 2)).Value = MyArray()
End With
wth the error message:
Rich (BB code):
Run-time error '434'
Object required
Thanks
<strike>
</strike>
Last edited: