Hide Rows with empty range
Posted on 2012-08-21
I am hoping you will be able to assist me since I can not seem to find the answer on this one.
I am trying to write some code that will hide rows if the following criteria is met:
(this will be reside in the sheet activate routine)
In Range("A6:A100") - if there are 3 or more consecutive cells in the range that are empty (no numeric/character) then it hides entire row until the end of the range, row 100. And, as long as those cells are empty too, which will almost always be the case - but I would like the code to check it before it hides, just in case.
The ideal situation is for it to start hiding rows starting with the 3rd row, keeping the first 2 visible and hiding all rows until the end of range is met. This will give me the opportunity to add a few items in each range without manually going through the process of unhiding rows.
I will duplicate this again for another range("A101:A200"). Then onto the others.
I have 7 ranges using this criteria. I can duplicate for the others, once I am educated.
This is a template I created for end-users to key data (in other columns) - I recently expanded the range areas for future expansion - but I want to hide these rows when I do not need them. I add or delete items on a routine basis - so I want it to be automated so I do not have to edit code on an on-going basis.
Thank you and I hope I explained this well enough for interpretation.