# Excel function/macro

Discussion in 'Business Applications' started by office38, Jan 8, 2013.

Not open for further replies.

Joined:
Dec 22, 2012
Messages:
4
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.

2. ### CDHarm

Joined:
May 26, 2011
Messages:
255
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.

Joined:
Dec 22, 2012
Messages:
4
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.

File size:
141 KB
Views:
9
4. ### CDHarm

Joined:
May 26, 2011
Messages:
255
Hi,

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

5. ### Garf13LD

Joined:
Apr 17, 2012
Messages:
455
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.

As Seen On