# Excel function/macro

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

#### office38

Hi all

I'm hoping that someone can tell me that what I'm trying to acheive is possible and fairly easy to do with an "IF" function.

I have a large workbook that I use to price construction work with. It is made up of a worksheet in which I input all the dimensions, which then auto-populate items in 14 additional worksheets to produce an overall cost.

Over the years, items have been added to the whole workbook in order to cover every type of construction. As a general rule I only require 28% of the items for any given job.

My question is this;

Can I add a column to me dimension sheet against each item in order to hide sections of the workbook that I do not require.

For example;

If "dimensions sheet" rows A10 to A44 are not required (Yes or No dropdown menu, which I can do), if "No" hide "Super-Structure sheet" rows 102 to 167.

Hope that makes sense and thank you in advance for any help provided.

#### CDHarm

Hi,

I do not know if a formula can be used, but you can use a code to hide or unhide the desired rows.
It's a matter of knowing when to Hide/Unhide.
If you can provide a redacted copy and sample we can better determine your request.

#### office38

Hi CDHarm

Thank you for your reply. If you look at the attached file, examples of what I'm trying to acheive are;

If Dimensions A16 = No, hide sheet 1 rows 19 to 38.

If Dimensions A32 = No, hide sheet 1 rows 39 to 43.

If Dimensions A109 = No, hide sheet 2 rows 119 to 130.

If Dimensions A121 = No, hide sheet 2 rows 120 to 128.

#### Attachments

• 141 KB Views: 9

#### CDHarm

Hi,

THe examples you gave will there be more than just the ones you posted?

#### Garf13LD

You can use an additional column to tie the value to the check cell.
Eg.
Sheet1 R19:R38 = Dimensions!\$A\$16
So if A16=No, then R19:R38 will also be no.
Then write a sub and embedded into sheetactivate event.
That means every time sheet1 is active, this macro will check for the values "No" in column R and then hide the entire row.

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On