VBA to Hide Blank Rows in Multiple Ranges of Spreadsheet

EdwardSurrey

New Member
Joined
May 13, 2015
Messages
36
Office Version
  1. 365
Platform
  1. Windows
Hello

I have a spreadsheet with four tables, each below one another.

Is it possible with VBA to press a button which will check whether there are any blanks in Column B (within each of the table ranges) and hide the relevant rows? I need the macro to work every time I initiate it, looking in Column B for rows it previously hide and unhiding any rows that now have data.

Also, because I may be inserting rows into the spreadsheet it would be good if the VBA could keep the range references. I've seen some VBA referencing specific cells which may move around, not being updated within the VBA.

Sorry for all the criteria, and hopefully for someone out there this is a simple fix! :) Thanks
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I have managed to solve it.
Hello

I have a spreadsheet with four tables, each below one another.

Is it possible with VBA to press a button which will check whether there are any blanks in Column B (within each of the table ranges) and hide the relevant rows? I need the macro to work every time I initiate it, looking in Column B for rows it previously hide and unhiding any rows that now have data.

Also, because I may be inserting rows into the spreadsheet it would be good if the VBA could keep the range references. I've seen some VBA referencing specific cells which may move around, not being updated within the VBA.

Sorry for all the criteria, and hopefully for someone out there this is a simple fix! :) Thank
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

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