Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Below is the code I've been using to hide or show a row based if "yes" or
"no" is selected in a validation box. This has been working. Now I would like to also hide a Tab if "no" is selected. How can I had a tab in addition to a row? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) Range("171:186").EntireRow.Hidden = (LCase(Range("b92")) = "no") End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Where will this "validation box" be if you hide the tab?
"jordanpcpre" wrote: Below is the code I've been using to hide or show a row based if "yes" or "no" is selected in a validation box. This has been working. Now I would like to also hide a Tab if "no" is selected. How can I had a tab in addition to a row? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) Range("171:186").EntireRow.Hidden = (LCase(Range("b92")) = "no") End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The validation box is on the same tab as the tab where I'm hiding the rows.
I would like to be able to hide a seperate tab. I can currently hide rows on a tab that has a validation box. With that same code, can I hide a seperate tab? Thanks! "TomPl" wrote: Where will this "validation box" be if you hide the tab? "jordanpcpre" wrote: Below is the code I've been using to hide or show a row based if "yes" or "no" is selected in a validation box. This has been working. Now I would like to also hide a Tab if "no" is selected. How can I had a tab in addition to a row? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) Range("171:186").EntireRow.Hidden = (LCase(Range("b92")) = "no") End Sub |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Something like this should do the job. You can link it to a worksheet event
or invoke it other ways. I like to create a text box, then assign the macro to the text box. It is simple and flexible. Sub HideASheet() ThisWorkbook.Worksheets("Sheet3").Visible = False End Sub "jordanpcpre" wrote: The validation box is on the same tab as the tab where I'm hiding the rows. I would like to be able to hide a seperate tab. I can currently hide rows on a tab that has a validation box. With that same code, can I hide a seperate tab? Thanks! "TomPl" wrote: Where will this "validation box" be if you hide the tab? "jordanpcpre" wrote: Below is the code I've been using to hide or show a row based if "yes" or "no" is selected in a validation box. This has been working. Now I would like to also hide a Tab if "no" is selected. How can I had a tab in addition to a row? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) Range("171:186").EntireRow.Hidden = (LCase(Range("b92")) = "no") End Sub |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Tom, Thanks for the help. In the macro you showed me, what are the
variables? I'm new with macros and need a little help. Sub HideASheet() ---does any reference go in the ()? ThisWorkbook ---do I name this the current used tab name or use this name? "Sheet3" ---I assume this is the worksheet I'm trying to hide False ---is this a reference to some cell? Remember, I'm trying to hide a seperate tab base whether or not a specific cell is labled as "Yes" or "No". Thank you! "TomPl" wrote: Something like this should do the job. You can link it to a worksheet event or invoke it other ways. I like to create a text box, then assign the macro to the text box. It is simple and flexible. Sub HideASheet() ThisWorkbook.Worksheets("Sheet3").Visible = False End Sub "jordanpcpre" wrote: The validation box is on the same tab as the tab where I'm hiding the rows. I would like to be able to hide a seperate tab. I can currently hide rows on a tab that has a validation box. With that same code, can I hide a seperate tab? Thanks! "TomPl" wrote: Where will this "validation box" be if you hide the tab? "jordanpcpre" wrote: Below is the code I've been using to hide or show a row based if "yes" or "no" is selected in a validation box. This has been working. Now I would like to also hide a Tab if "no" is selected. How can I had a tab in addition to a row? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) Range("171:186").EntireRow.Hidden = (LCase(Range("b92")) = "no") End Sub |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Sub HideA Sheet() --- leave it just as it is. "ThisWorkbook" would not need to change as long as you copy the code into the workbook the workbook you are working on. "Sheet3" is in fact the name of the worksheet you are addressing and needs to be in quotes. "False" means that the referenced sheet will be hidden, "True" means the referenced sheet will be visible. You could put this in an if statement like this. Sub HideA Sheet() If ThisWorkbook.Worksheets("Where the Cell Is").Range("A3").value = "Yes" Then ThisWorkbook.Worksheets("Sheet3").Visible = False Else ThisWorkbook.Worksheets("Sheet3").Visible = True End If End Sub "jordanpcpre" wrote: Tom, Thanks for the help. In the macro you showed me, what are the variables? I'm new with macros and need a little help. Sub HideASheet() ---does any reference go in the ()? ThisWorkbook ---do I name this the current used tab name or use this name? "Sheet3" ---I assume this is the worksheet I'm trying to hide False ---is this a reference to some cell? Remember, I'm trying to hide a seperate tab base whether or not a specific cell is labled as "Yes" or "No". Thank you! "TomPl" wrote: Something like this should do the job. You can link it to a worksheet event or invoke it other ways. I like to create a text box, then assign the macro to the text box. It is simple and flexible. Sub HideASheet() ThisWorkbook.Worksheets("Sheet3").Visible = False End Sub "jordanpcpre" wrote: The validation box is on the same tab as the tab where I'm hiding the rows. I would like to be able to hide a seperate tab. I can currently hide rows on a tab that has a validation box. With that same code, can I hide a seperate tab? Thanks! "TomPl" wrote: Where will this "validation box" be if you hide the tab? "jordanpcpre" wrote: Below is the code I've been using to hide or show a row based if "yes" or "no" is selected in a validation box. This has been working. Now I would like to also hide a Tab if "no" is selected. How can I had a tab in addition to a row? Thanks! Private Sub Worksheet_Change(ByVal Target As Excel.Range) Range("171:186").EntireRow.Hidden = (LCase(Range("b92")) = "no") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can we modify any of the ribbon tabs or create new ribbon tabs? | New Users to Excel | |||
hide tabs from view then lock tabs? | Excel Discussion (Misc queries) | |||
Can i set up tabs within tabs on Excel? | Excel Worksheet Functions | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Hiding Rows & Tabs at the same time | Excel Discussion (Misc queries) |