Hide / Unhide Rows Based on Nonadjacent Empty Cells

Magdoulin

Board Regular
Joined
Jan 11, 2013
Messages
73
Hi guys, how is everything?
Look, I seek your assistance here.

I’m trying to design a button to hide/unhide rows based on the empty cells in fixed column.

For example, the range is from A1:Z30 (1:1 is the heading row for the table).

The controlling column of the code is going to be G and G1 is always non-empty (as it belongs to the heading row), so we got a base here :D

But the dilemma that the empty cells in G column don’t have fixed positions along the column as it is going to be a dynamic range, and they are nonadjacent in unfixed way too.

So how to sort this out?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Not quite sure that I understand this statement:
But the dilemma that the empty cells in G column don’t have fixed positions along the column as it is going to be a dynamic range, and they are nonadjacent in unfixed way too.
But if it is what I think it is, can't you just use Filters on column G to hide rows where G is empty?

If that is not what you are after, then perhaps it would be more clear if you could post a data sample, and explain what you want to happen in that example.
 
Last edited:
Upvote 0
Not quite sure that I understand this statement:

But if it is what I think it is, can't you just use Filters on column G to hide rows where G is empty?

If that is not what you are after, then perhaps it would be more clear if you could post a data sample, and explain what you want to happen in that example.


The filter is an option of course but I am trying to design an easy to go project for end users who aren't that familiar with Excel.

I'm not really sure how to upload attachment to this thread, I can't see the option for that while I'm replying you now.
 
Upvote 0
You cannot upload files to this site. But there are tools you can use to post screen images. They are listed in Section B of this link here: http://www.mrexcel.com/forum/board-a...forum-use.html.
Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.

The filter is an option of course but I am trying to design an easy to go project for end users who aren't that familiar with Excel.
You can create VBA code to do this for you (and attach it to a button).
You can get most of the VBA code needed to do this filter by turning on the Macro Recorder, and record yourself creating the filter manually.
Then, you will just need to do a little cleanup to make it dynamic.

It sounds like the number of rows may change. Is there one column that ALWAYS has data in it that we can use to find where the last row of data is (since column G may have blanks, that is not a good column to use to locate the last data row)?
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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