I have a work book with 18 work sheets. The first is a Main input sheet, the 2nd is a print friendly sheet and the other 16 are hidden. When certain products are selected on the Main sheet, the information is copy and pasted to the Print sheet (in white font).
I need a Command Button so that when the user is done on the Main sheet, they click the button and it reads the cells on the print sheet to unhide any of the other 16 sheets but only if the product was selected.
Example. Input sheet has Apples as a choice. The click on this and the word "apples" is pasted onto the Print sheet at A77. 8 total customers can have an input, so A77 through H77 can all have Apples in the cells.
Second product is Oranges, that wording is on the Print sheet A78 through H78.
When done, I need the command button to read the row for Apples, and if all cells have no data, then the Apples sheet stays hidden. If there is data, the Apples sheet is unhidden.
Then I need the same command button to apply the same principal to the oranges row.
I've tried the below, but can't get it to work.
Private Sub CommandButton10_Click()
If Sheets("Print").Range("A77, B77, C77, D77, E77, F77, G77, H77").Value = "" Then
Sheets("Apples").Visible = False
Else: Sheets("Apples").Visible = True
If Sheets("Print").Range("A78, B78, C78, D78, E78, F78, G78, H78").Value = "" Then
Sheets("Oranges").Visible = False
Else: Sheets("Oranges").Visible = True
End If
End If
End Sub
I can get it to work if i take off all of the 2nd If/Then Stmt.
I need a Command Button so that when the user is done on the Main sheet, they click the button and it reads the cells on the print sheet to unhide any of the other 16 sheets but only if the product was selected.
Example. Input sheet has Apples as a choice. The click on this and the word "apples" is pasted onto the Print sheet at A77. 8 total customers can have an input, so A77 through H77 can all have Apples in the cells.
Second product is Oranges, that wording is on the Print sheet A78 through H78.
When done, I need the command button to read the row for Apples, and if all cells have no data, then the Apples sheet stays hidden. If there is data, the Apples sheet is unhidden.
Then I need the same command button to apply the same principal to the oranges row.
I've tried the below, but can't get it to work.
Private Sub CommandButton10_Click()
If Sheets("Print").Range("A77, B77, C77, D77, E77, F77, G77, H77").Value = "" Then
Sheets("Apples").Visible = False
Else: Sheets("Apples").Visible = True
If Sheets("Print").Range("A78, B78, C78, D78, E78, F78, G78, H78").Value = "" Then
Sheets("Oranges").Visible = False
Else: Sheets("Oranges").Visible = True
End If
End If
End Sub
I can get it to work if i take off all of the 2nd If/Then Stmt.