TheRedCardinal
Active Member
- Joined
- Jul 11, 2019
- Messages
- 250
- Office Version
- 365
- 2021
- Platform
- Windows
I have a commonly used bit of code that loads a whole worksheet into an array for data manipulation.
It looks like this:
I'm getting an overflow error on the "PurchaseData = WS1.UsedRange" line - the used range, confirmed by checking in Immediate is 16 columns by 4360 rows, and much smaller than other instances of using this process.
Can anybody see what I've done wrong here?
It looks like this:
VBA Code:
Set WBk1 = ThisWorkbook
Set WS1 = WBk1.Sheets("5. Purchases")
Set WS2 = WBk1.Sheets("10. Input Summary")
Set WS3 = WBk1.Sheets("1. Start")
Dim PurchaseData As Variant, Inputs As Variant, TCodes As Variant
PurchaseData = WS1.UsedRange
Inputs = WS2.Range("InputSummary")
I'm getting an overflow error on the "PurchaseData = WS1.UsedRange" line - the used range, confirmed by checking in Immediate is 16 columns by 4360 rows, and much smaller than other instances of using this process.
Can anybody see what I've done wrong here?