Conditional Input Cells

  • Thread starter Thread starter gsullymorgan
  • Start date Start date
G

gsullymorgan

Sadly no (but thanks forthe rapid reply).

B5 is actually the input cell where the value is entered. I'd reall
like that cell not to be there / usable / visible unless there is
spouse
 
Hi

then you'll need to use code similar to the following
(this needs to go against the sheet module of the worksheet with the
questions in it ... to get here, right mouse click on the sheet tab and
choose view code - on the left hand side of the screen you should see your
workbook name in bold and the sheet you're in highlighted), now double click
on the sheet and then on the white area on the right copy & paste the
following)

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Address = "$B$1" And UCase(Target.Value) = "NO" Then
Rows("5:5").Select
Selection.EntireRow.Hidden = True
Else
Rows("5:5").Select
Selection.EntireRow.Hidden = False
End If
Range("C3").Select
Application.EnableEvents = True
End Sub
--
to get back to your workbook use ALT & F11 ... change B1 to "No" and row 5
should disappear, change it to "Yes" and it should come back again

Cheers
JulieD
 
gully

In A5 enter =IF(B1="no","","age of spouse")

If B1 is "no" then A5 will be blank.

If you really want to delete/hide the rwo, Julie's code should do the trick.

Gord Dibben Excel MVP


Gord Dibben Excel MVP
 
Back
Top