Hi,
I have googled my fingers sore trying to figure this out but have not found anything. Is there a code I can assign to a toggle button to only show rows with todays date and 30 days ahead?
The file uploaded is a very easy example of list.
Hi,
I have googled my fingers sore trying to figure this out but have not found anything. Is there a code I can assign to a toggle button to only show rows with todays date and 30 days ahead?
The file uploaded is a very easy example of list.
Hi again @MetteKvidal.
You did not close your previous topic, but have already opened a new topic. Was your issue resolved in the previous topic?
NOTE: As the original poster/owner, only you can mark your thread as SOLVED (Thread Tools above Post #1).
You can say "Thanks" in your thread to everyone who offered to help you.
You can also reward them by clicking * "Add Reputation" under their username on the left.
With Regards, MikeVol.
Hi,
Yes it was I have marked it as "solved" now. Thanks for reminding me
Ok, Try next code for your sample workbook:
Please Login or Register to view this content.
Last edited by MikeVol; 03-26-2024 at 07:45 PM. Reason: Attach the Sample Workbook
Is there a reason why you would want to hide the rows rather than use a filter?
Thank you for your prompt response.
I can see the code works perfectly in the attached document except that it also show days from before today. My original text was maybe somewhat not clear about that.
When implementing the code to my document and changing what I see needs to change to make it work (correct Toggle button, correct name of work sheet and the column containing the dates) it still doesn't work. There are rows in between with blanks, does this effect the code? Also, column A is blank in my sheet.
"Set rng = ws.Range("B2:B" & ws.Cells(ws.Rows.Count, "A").End(xlUp).Row)" --> I changed this codeline to correct column and start cell. I also tried to change the "A" to "B" with no effect.
Do you see what might be the reason for it not to work in my document?
Thank you for your time, it is highly appreciated.
Yes, it is just to make it easier. The document is used in meetings with several people watching when the document is used. So it is just more convenient to use a button instead of all the meeting attendees watching while I use time to filter the next 30 days. The document is used in meetings weekly so the function with the button is something that often will be used.
Hello @MetteKvidal!
Can you make an example file as similar as possible to your original file in structure, without personal data? Attach it to the post, Ill be next to the computer and take a look at it.
Perhaps someone else will be able to help you before I get to the computer, times are hard these days. Good luck.
Maybe?
Please Login or Register to view this content.
Ouch, seems to be a "bug" here. When using this code in Toggle button 3 it works perfectly in sorting out only the next 30 days in column W, but with only one error; when pressing the button again to show all data, row 141 to 181 stays hidden. I have to 'right-click' the rows and press "unhide" to make them appear again. Any idea what may cause this?
And is there possible to make the appearance of the rows in this button with "sort oldest to newest in column W"? With a reset of this when clicking the button to make all rows appear again? I assume it's a great ask, but to my knowledge, there are so many possibilities in excel, so I don't see any harm in asking you experts
Would love to close this post and mark it as "solved". Is there anyone that has any idea about my previous post and the "bug"?
Thanks!
I think it's because you also have grouping which hides rows. Try adding the highlighted line to expand all the groups before performing the hide/show.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks