I'm having issues getting the multiple If statement to work after the second statement. I have 2500 rows of data questions sets that are tied to a 217 item drop down list. What I'm trying to code is, that the questions applicable will populate based on the selected operation of the drop down list. Questions applicable per operation vary from 3 - 12, and questions not applicable to the selection should automatically hide the rows. I've tried multiple variations of code, using ElseIf, If, combination If and ElseIf, combination If and Or_ (this is the most recent) as shown below. Can someone please advise on this? I don't know what else to try and I need to add the additional 213 variables to the code.....Thanks
Sub Hide_Rows()
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim TrigerCell As Range
Set Triggercell = Range("$J$14")
If Not Application.Intersect(Triggercell, Target) Is Nothing Then
If Triggercell.Value = "Electrician, farm based business" Then
Rows("19:2500").Hidden = False
Rows("26:2500").Hidden = True
Or_
If Triggercell.Value = "Plumbing and heating contractors, farm based business" Then
Rows("19:2500").Hidden = False
Rows("19:25", "47:2500").Hidden = True
Or_
If Triggercell.Value = "Plumbing contractors (plumber), farm based business" Then
Rows("19:2500").Hidden = False
Rows("19:46", "55:2500").Hidden = True
Or_
If Triggercell.Value = "Assembly and installation of agricultural equipment in farm outbuildings, for others, farm based business" Then
Rows("19:2500").Hidden = False
Rows("19:55", "61:2500").Hidden = True
End If
End If
End Sub
End Sub
End Sub
Aucun commentaire:
Enregistrer un commentaire