Macro: Hide groups of rows based on column value

dplmartin

New Member
Joined
May 24, 2012
Messages
1
Hi,

Please could you help me to write a macro to filter a spreadsheet. Here is a screengrab of some sample data.

extreport.jpg


You can see that the data is in blocks, separated by blank rows. Starting from the first row after the header that contains data (13 in this case), I want to evaluate whether Column E contains the value 260 or 255.

If it does contain one of those values, I want to move onto the next row that appears after a blank row and perform the evaluation again. If one of those values isn't present, I want it to hide all the rows until the next blank row. Then, so that I don't end up with huge gaps in the spreadsheet, it will need to take note of its position and hide the blank row as well before looping to perform the evaluation again.

In the screengrab, all I would expect to see after the macro has run is rows 16 and 17. Rows 13, 14 and 15 would be hidden.

I did find this post on hiding rows based on data in columns but I don't know how to deal with the groups of rows and the blank rows.
http://www.mrexcel.com/forum/showthread.php?t=401271

Thanks in advance.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top