View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Daniel R. Young Daniel R. Young is offline
external usenet poster
 
Posts: 38
Default Hidden Row in seperate worksheet.

It does work, but only when I am in visual basic and I hit the play button.
It will not do it automactically. I want the row to hide once the cell=no.

dAn

"Ken Hudson" wrote:

Dan,
For sure you are missing two "end If" statements:

Private Sub Worksheet_Calculate()
If Worksheets("Hospital").Range("B5").Value = "No" Then
Worksheets("Interview").Range("E9").EntireRow.Hidd en = True
End If
If Worksheets("Hospital").Range("B5").Value = "Yes" Then
Worksheets("Interview").Range("E9").EntireRow.Hidd en = False
End If
End Sub

Does it work with those inserted?

And if B5 has to be either Yes or No then:

Private Sub Worksheet_Calculate()
If Worksheets("Hospital").Range("B5").Value = "No" Then
Worksheets("Interview").Range("E9").EntireRow.Hidd en = True
Else
Worksheets("Interview").Range("E9").EntireRow.Hidd en = False
End If
End Sub


--
Ken Hudson


"Daniel R. Young" wrote:

I am trying to hide a row when a cell in a different worksheet says no. Here
is my code:

Private Sub Worksheet_Calculate()
If Worksheets("Hospital").Range("B5").Value = "No" Then
Worksheets("Interview").Range("E9").EntireRow.Hidd en = True
If Worksheets("Hospital").Range("B5").Value = "Yes" Then
Worksheets("Interview").Range("E9").EntireRow.Hidd en = False
End Sub

It will not work. Can someone assist me?

thank you,

dan