liabilityquek
New Member
- Joined
- Oct 17, 2021
- Messages
- 25
- Office Version
- 2019
- Platform
- Windows
Hi,
I have entered the VBA code to hide the respective rows if certain criteria is being met. However, the rows doesn't seem to hide or unhide. Please assist on which area did it gone wrong.
Thanks in advance!
I have entered the VBA code to hide the respective rows if certain criteria is being met. However, the rows doesn't seem to hide or unhide. Please assist on which area did it gone wrong.
Thanks in advance!
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C16") = "Private Company Ltd by Shares" Or Range("C16") = "Exempt Company Ltd by Shares" Or Range("C16") = "Public Company Ltd by Shares" Or Range("C16") = "FOREIGN COMPANY REGISTERED IN SINGAPORE" Then
If Range("C7") = "No" Then
Rows("38:41").EntireRow.Hidden = True
Rows("34:35").EntireRow.Hidden = True
Rows("30:31").EntireRow.Hidden = True
Rows("28").EntireRow.Hidden = True
Else
Rows("32:33").EntireRow.Hidden = False
Rows("36:37").EntireRow.Hidden = False
Rows("29").EntireRow.Hidden = False
If Range("C16") = "Private Company Ltd by Shares" Or Range("C16") = "Exempt Company Ltd by Shares" Or Range("C16") = "Public Company Ltd by Shares" Or Range("C16") = "FOREIGN COMPANY REGISTERED IN SINGAPORE" Then
If Range("C7") = "Yes" Then
Rows("34:37").EntireRow.Hidden = True
Rows("40:41").EntireRow.Hidden = True
Rows("30:31").EntireRow.Hidden = True
Rows("28").EntireRow.Hidden = True
Else
Rows("32:33").EntireRow.Hidden = False
Rows("38:39").EntireRow.Hidden = False
Rows("29").EntireRow.Hidden = False
If Range("C16") = "Private Company Ltd by Shares" Or Range("C16") = "Exempt Company Ltd by Shares" Or Range("C16") = "Public Company Ltd by Shares" Or Range("C16") = "FOREIGN COMPANY REGISTERED IN SINGAPORE" Then
If Range("C7") = "Credit Re-assessment" Then
Rows("34:39").EntireRow.Hidden = True
Rows("30:31").EntireRow.Hidden = True
Rows("28").EntireRow.Hidden = True
Else
Rows("32:33").EntireRow.Hidden = False
Rows("40:41").EntireRow.Hidden = False
Rows("29").EntireRow.Hidden = False
Rows("35").EntireRow.Hidden = False
End If
End If
End If
End If
End If
End If
End Sub