Rick Norris
asked on
Another Hide/Show Excel rows question
I have reviewed questions answered concerning hiding and showing rows in Excel; however, I have not quite found something that I could modify to obtain the results I need.
If the experts here would take a look at my attached spreadsheet, it gives a very detailed example of what I am needing. Any and all help is greatly appreciated.
Thanks,
Example.xlsx
If the experts here would take a look at my attached spreadsheet, it gives a very detailed example of what I am needing. Any and all help is greatly appreciated.
Thanks,
Example.xlsx
In any case try this macro.
Sub ShowHide()
Dim strListBoxValue As String
Dim rngFound As Range
Dim lngRow As Long
strListBoxValue = "Company 1"
Set rngFound = Columns("A:A").Find(What:=strListBoxValue, LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
For lngRow = rngFound.Row + 1 To ActiveSheet.UsedRange.Rows.Count + 1
If Cells(lngRow, "B") = "" Then
Exit For
End If
If UCase(Cells(lngRow, "D")) = "X" Then
Cells(lngRow, "A").EntireRow.Hidden = True
Else
Cells(lngRow, "A").EntireRow.Hidden = False
End If
Next
End Sub
ASKER
Martin:
Rows to be dynamically hidden/shown are on the "Example" sheet.
Please review that sheet....
Thanks,
Rows to be dynamically hidden/shown are on the "Example" sheet.
Please review that sheet....
Thanks,
Please review that sheet....I did and my code hides Criteria 2 for Company 1. What should it do differently?
ASKER
If you could attach the spreadsheet you are working with would be appreciated..... When I paste in code I get an error....
When Company changes on the "EXAMPLE" sheet, then DECISION MATRIX tab is evaluated to determine what rows to hide or show on the EXAMPLE sheet.
Thanks
When Company changes on the "EXAMPLE" sheet, then DECISION MATRIX tab is evaluated to determine what rows to hide or show on the EXAMPLE sheet.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Martin:
Thanks for the workbook.... Works for what I need.... Now I just need to expand on your work for my real world problem.
Thanks again!!
Thanks for the workbook.... Works for what I need.... Now I just need to expand on your work for my real world problem.
Thanks again!!
Let me know (here if you like) if you need help. In any case you're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
Is a VBA solution acceptable?