-
May 24th, 2022, 03:27 AM
#1
Thread Starter
New Member
[Excel] Have a VBA String-Array To Point to a Specific Cell of Another String Array
Hello guys. I have an extremely large array of String in Excel VBA and I want to dump different parts of it onto different worksheets. To make is faster, I'm of course intending to do a single-step dump, so if I call that big array "DataCache ()" I want to do something like:
Sheets (1).Range ("B2").Resize (1000000,250).Value = DataCache (2,2) ' Starting from the slot (2,2) of the array and dump onto sheet1
Sheets (2).Range ("B2").Resize (1000000,250).Value = DataCache (2000000,5) ' Similar thing from array slot (2000000,5) for sheet2
...
Is there any way to do this without having to copy the 2nd portion of the array into a new array? I was thinking maybe I can do something like (conceptually):
Dim SubArry () As String
....
SubArray = VarPtr ( DataCache (2000000, 5))
Sheets (2).Range ("B2").Resize (1000000,250).Value = SubArray
I'd appreciate if anyone can help me with this. I'm using "Microsoft VBA 7.1" on Office 2021.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|