Worksheet change macro for hiding rows and columns

elmacay

Board Regular
Joined
May 4, 2006
Messages
88
Hi all,

I would like to make a worksheet change macro that hides rows and columns based on cell values for a planning tool.

In columns B:BA, there are the week numbers 1 - 52. In rows 3:200, there are tasks. Names of tasks are in A3:A200.

In words, it would be something like this:

If there is any value in any of the tasks in weeks 10 through 14 (corresponding with range J3:N200, 10 to be entered in cells BB1, 14 in BB2), don't hide those rows, but hide all other rows in range 10:200. Also hide columns A:I and O:AZ. If BB1 or BB2 are empty, show all rows and columns.

Extra thing: I also would like it to be possible to enter weeks covering the year change, like week 48 until week 4, and thus hide weeks 5 through 47.

I've tried glueing together macros that I've found, but it's out of my league.

Any help is greatly appreciated!

Thanks,
Elmacay
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

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