Hi Everyone,
I am very new to VBA and I am trying to make a row disappear based off the result of an 'IF' formula in a cell.
So if the the formula in (L86) comes back as 'Fail', I would like row 87 to appear however if the formual comes back as "" (Blank) i want the row to disappear.
This is my formula for L86: =IFERROR(IF(AND(L83>200,L85<=7,L25="Yes"),"","Fail"),"") which works fine but i can't get the VBA to work:
This is my current code:
The unlighted section works fine, it the red section that is not working. Hoping someone could assist. Thank you for you assistance
I am very new to VBA and I am trying to make a row disappear based off the result of an 'IF' formula in a cell.
So if the the formula in (L86) comes back as 'Fail', I would like row 87 to appear however if the formual comes back as "" (Blank) i want the row to disappear.
This is my formula for L86: =IFERROR(IF(AND(L83>200,L85<=7,L25="Yes"),"","Fail"),"") which works fine but i can't get the VBA to work:
This is my current code:
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = ("$C$67") Then
Sheet11.Unprotect Password:="XX"
If Target.Text = "All in One" Then
Rows("81").EntireRow.Hidden = True
Sheet11.Protect Password:="XX"
ElseIf Target.Text = "Credit Card" Then
Rows("81").EntireRow.Hidden = True
Sheet11.Protect Password:="XX"
ElseIf Target.Text = "Personal Loan" Then
Rows("81").EntireRow.Hidden = True
Sheet11.Protect Password:="XX"
ElseIf Target.Text = "Overdraft" Then
Rows("81").EntireRow.Hidden = True
Sheet11.Protect Password:="XX"
ElseIf Target.Text = "" Then
Rows("81").EntireRow.Hidden = True
Sheet11.Protect Password:="XX"
ElseIf Target.Text = "Home Loan" Then
Rows("81").EntireRow.Hidden = False
Sheet11.Protect Password:="XX"
ElseIf Target.Text = "Invest Loan" Then
Rows("81").EntireRow.Hidden = False
Sheet11.Protect Password:="XX"
If Target.Address = ("$L$86") Then
Sheet11.Unprotect Password:="XX"
If Target.Text = "" Then
Rows("87").EntireRow.Hidden = True
Sheet11.Protect Password:="CreditARA"
ElseIf Target.Text = "Fail" Then
Rows("87").EntireRow.Hidden = False
Sheet11.Protect Password:="CreditARA"
End If
End If
End If
End If
End Sub
The unlighted section works fine, it the red section that is not working. Hoping someone could assist. Thank you for you assistance
Last edited by a moderator: