Hide and unhide equations?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Am I am able to hide and unhide a row by using an equation in excel? Bascially I want to have a row hidden until a value in a specific cell is No. Then I want it to be unhidden

Thank you

Dan Young
 
Dan,

You would need to use the worksheet's calculate event: for row 1 based
on cell A1:

Private Sub Worksheet_Calculate()
If Range("A1").Value = "No" Then Range("A1").EntireRow.Hidden = False
End Sub

Change the first A1 to your cell with the value, and the second to any
cell in the row you want to unhide.

Copy this code, right click on your sheet tab, and select "View Code"
then paste the code in the window that appears.

HTH,
Bernie
MS Excel MVP

Dan Young said:
Am I am able to hide and unhide a row by using an equation in excel?
Bascially I want to have a row hidden until a value in a specific cell
is No. Then I want it to be unhidden.
 
Bernie,
I just need one more thing. I am working with sperate sheets in a workbook. How do I do the code for a different sheet?

Thank you,

Dan
 
Dan,

Put this code into the codemodule of the "ThisWorkbook" object:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
If Worksheets("Sheet1").Range("A1").Value = "No" Then _
Worksheets("Sheet2").Range("A1").EntireRow.Hidden = False
End Sub

Change the sheet and range names as appropriate.

HTH,
Bernie
MS Excel MVP

Dan Young said:
Bernie,
I just need one more thing. I am working with sperate sheets in a
workbook. How do I do the code for a different sheet?
 
Back
Top