Hello everyone
I am trying to store the filtered visible rows of a table but I encountered an error
This is the code I am trying to use
and this is the error![]()
Please Login or Register to view this content.
001.png
Any idea how to fix that?
Hello everyone
I am trying to store the filtered visible rows of a table but I encountered an error
This is the code I am trying to use
and this is the error![]()
Please Login or Register to view this content.
001.png
Any idea how to fix that?
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
Unprotect the sheet before this piece of code then protect it again after.
Or, set the protection with UserInterfaceOnly = True in the workbook open event so that the VBA can act on the sheet with it still protected.
BSB
Thanks a lot for pointing out that .. but the array still not correct ..
The array shows only two rows of the filtered data and one column !!![]()
Please Login or Register to view this content.
Help.png
Any help in this topic please?
Easier to to help if we can see the workbook. Can you attach it?
Anonymize any sensitive data first.
BSB
Here's a sample workbook
Hi Yasser,
This works on the unprotected sheet:
![]()
Please Login or Register to view this content.
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
Thanks a lot my friend
But I need to store the data inside the table only (only visible rows in the table) ..
The sheet has other data ..
That's a point.
Another point as for your code it deals with the hidden rows too and this is not desired
And when I tried to add this line I got an error(424) : Object required
![]()
Please Login or Register to view this content.
Hi Yasser old friend,
Where do you want to store the data?
![]()
Please Login or Register to view this content.
Last edited by xladept; 04-14-2018 at 01:55 PM.
Thanks a lot for solution
Is there a way to avoid the copy part and store directly the databodyrange of the table ..!! I expect there is a way and I have googled a lot but with no luck
I thought of a way by converting the table to range then converting the range again to table
I used this line to convert the table to range
But the problem is that I lose the filtering process after converting ..![]()
Please Login or Register to view this content.
So is there a way to keep the filtered data after converting?
Hi Yasser,
Thanks for the rep!
This seems to work:
![]()
Please Login or Register to view this content.
Last edited by xladept; 04-15-2018 at 12:08 AM.
Thank you very very much my friend. I appreciate a lot your help
It seems there is no way escaping the loops (and this cause slow in execution as the original data is too large)
Generally the thread will be open for others to share their ideas
Thanks a lot for great help
You're welcome old friend, probably establishing a worksheet array on a temporary sheet would be the quickest![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks