Hide rows based on answer in a drop-down box

AndyB63

New Member
Joined
Feb 27, 2015
Messages
23
Greetings,

I'm new here and would like some assistance on VBA coding. I have a specific query which has defeated my lack of expertise.

In one tab of a spreadsheet, I have a drop-down box (E19) with 5 possible answers, let's call them This, That, TheOther, Another, YetAnother.

Based on the option chosen, I would then like to hide rows within range rows 19 to 76.

If "This" is chosen, hide rows 19 to 28 and 41 to 76;
If "That" is chosen, hide rows 29 to 76;
If "TheOther" is chosen, hide rows 19 to 40 and 53 to 76.....and so on.

What would the VBA coding be for this?

I'd be grateful for any assistance.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
use an if function for each answer in the dropdown.
find out the syntax for hiding rows by recording macro
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,109
Members
449,205
Latest member
ralemanygarcia

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