Forum Discussion
Macros for hiding rows based on date
NikolinoDE Thank you! Yes it did work except I used it to search in the F Column but it starts searching around row 1100 - Is there a way to have it only search until the last row - which could change as information is added to the main sheet.
It should look for the date and hide or unhide from there.
What if a date in between ends before?
In the end anything is possible, it depends on the effort.
Should it only take the last entered date in F and then work up according to your requirements?
I don't recommend it, but if that's your wish ... I'll try to prepare it for you (starting tomorrow, after church and after Bistro :).
I think I'll have found the time by the day after tomorrow :)).
To be on the safe side, please describe to me step by step what the Macros should do.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
- MVelveNov 06, 2020Copper Contributor
NikolinoDE Thank you! The first worksheet is entered by Admin staff. and needs to be left as is. The "Summary" sheet is the one we want to update and hide rows.
The dates in column F will be the date that the worksheet "Summary" goes by. The rows that are "< Date - 1" in column F will be hidden. Maybe another value to search would be that the Name has a value in it so that only the rows with a name and the dates will show in the Macro. What is your recommendation to make this better? A button will be created so when it is pressed, it will update the sheet based on this macro. What we want the Senior Staff to see are only the names of staff that are still not available for work. Another button would be created to unhide the rows if needed. Is this enough information from me?- NikolinoDENov 06, 2020Platinum Contributorabout searching around row 1100. Just change Range("A" & i).Select to Range("F2:F100" & i).Select, i think then search only 100 rows. Rest follows 🙂
- MVelveNov 06, 2020Copper Contributor
NikolinoDE Thank you! That did not work for me but will keep working on it. The best way to describe it is in the 2nd worksheet, if Column A2 ( or all of Column A) row 2 (multiple rows) has a value in it (the name) and Column F2 (all of column F2) row 2 (multiple rows) has a date earlier than today (<date) then hide the row. Would also like to unhide if needed. Hope this makes sense.