Blanchetdb
Board Regular
- Joined
- Jul 31, 2018
- Messages
- 161
- Office Version
- 2016
- Platform
- Windows
If presently have the following coding and it works for this specific case but I need to add other options as well
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$37" Then
Dim arCases As Variant
Dim res As Variant
arCases = Array("Term", "Indeterminate", "Transfer", "Student", "Term extension", "As required", "Assignment", "Indéterminé", "Mutation", "Selon le besoin", "Terme", "prolongation du terme", "affectation", "Étudiant(e)")
res = Application.Match(Target, arCases, 0)
If IsError(res) Then
Rows("104:112").Hidden = False
Else
Rows("104:112").Hidden = True
End If
End Sub
I need to add other option such as:
If Target.Address = "$H$04" Then
Dim arCases1 As Variant
Dim res1 As Variant
arCases1 = Array("X")
res1 = Application.Match(Target, arCases1, 0)
If IsError(res1) Then
Rows("36:77").Hidden = True
Else
Rows("36:37").Hidden = False
End If
End Sub
How do I merge them together and enable myself to add even more options as my form progresses?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$37" Then
Dim arCases As Variant
Dim res As Variant
arCases = Array("Term", "Indeterminate", "Transfer", "Student", "Term extension", "As required", "Assignment", "Indéterminé", "Mutation", "Selon le besoin", "Terme", "prolongation du terme", "affectation", "Étudiant(e)")
res = Application.Match(Target, arCases, 0)
If IsError(res) Then
Rows("104:112").Hidden = False
Else
Rows("104:112").Hidden = True
End If
End Sub
I need to add other option such as:
If Target.Address = "$H$04" Then
Dim arCases1 As Variant
Dim res1 As Variant
arCases1 = Array("X")
res1 = Application.Match(Target, arCases1, 0)
If IsError(res1) Then
Rows("36:77").Hidden = True
Else
Rows("36:37").Hidden = False
End If
End Sub
How do I merge them together and enable myself to add even more options as my form progresses?
Last edited: