Hello all gurus
I have macro that needs to hide all rows that have column A date outside given date range but it is not working.
Here is macro
Please Login or Register to view this content.
Kindly check
Hello all gurus
I have macro that needs to hide all rows that have column A date outside given date range but it is not working.
Here is macro
Please Login or Register to view this content.
Kindly check
Last edited by caabdul; 02-22-2018 at 08:43 AM.
Here's an alternative VBA
Please Login or Register to view this content.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Hi Alansidman
2 questions about your code:
1- If there are 5000 Rows, will your code be fast?
2- If those 5000 Rows are already hidden and are outside given date range, will this code unhide those?
Regards
1. Don't know. Time it if that is an issue for you.
2. this code will not unhide anything.
Actually I want to hide all dates that are outside given range.
Strange thing is that this code is working on all other sheets, but on this sheet it just hides Row 8 whatever I do.
Last edited by caabdul; 02-22-2018 at 03:43 AM.
Suggest you add a line of code at the beginning to unhide all hidden lines and then run your code to hide those lines that meet your criteria.
Which code are you referring to? The word "this" does not tell me which code.Strange thing is that this code is working on all other sheets,
Try this
Please Login or Register to view this content.
Code fixedActually I want to unhide all dates that are outside given range.
Last edited by jindon; 02-22-2018 at 12:39 AM.
Hi Jindon
Many thanks, your code works.
But it is still big confusion why my code is not working. Hope somebody can look into it.
Regards
1) Wrong range, 2) Not resetting existing filter
Please Login or Register to view this content.
My Code given at startWhich code are you referring to? The word "this" does not tell me which code.
I want to filter starting from Row 101) Wrong range
Please check attached file. It is working with same code as I gave in first post.1) Wrong range, 2) Not resetting existing filter
Last edited by caabdul; 02-22-2018 at 04:01 AM.
Your original code says
???Please Login or Register to view this content.
That is typo, but replacing it with 10 doesn't help
As I already mentioned, add one line
Please Login or Register to view this content.
Ah, at last it worked.
But if you check my second file "RowHide-Working.xlsm" it is working without adding "activesheet.autofiltermode = false" code. What is happening there?
You have no such code attached to the workbook.
If it works, perhaps it is not filtered yet.
Code is attached to file as macro.
Now
when I added "activesheet.autofiltermode = false" code to macro of non-working file, it started working. Then I removed this code and that file is still working.
Now what we can make of it?
Then what's the problem?
You are uploading the code that has a typo, and the 2nd file with the different range code???
So, I don't see the cause of the error.
I don't know but "activesheet.autofiltermode = false" did the trick. It enabled the sheet to accept my macro and after that macro worked even when I removed this small code.
Anyways, many thanks for your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks