on 05-19-2020 5:09 PM
Hi
I'm looking to refer to a crosstable as a ListObject within VBA, however I cannot figure it out how to.
Power Query does recognize BEx crosstables as table, therefore I was thinking I could do the same with VBA.
I'm trying to do the following, however it runs into an error, saying subscript out of range, meaning it cannot be found. Any ideas?
dim tbl as ListObject
set tbl = mysheet.ListObject("SAPCrosstable1")
Thanks!
Try this
Dim DirArray As Variant
DirArray = mysheet.Range("SAPCrosstable1").Value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Alen!
The reason I was looking to do this, because I wanted to copy the dataset (without headers) from the Crosstable(s) without having to check the last row / last column. I guess it would be still faster to copy/paste the dataset with the Range.Copy / PasteSpecial method, rather than looping through the whole array.
Regardless I've learned something new!
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.