Hi everyone. I keep getting an error (1004 - application-defined or object-defined error) that I can't fix. I tried moving the code I have from the worksheet to a module, that didn't work.
Situation; I have two groups of drop lists. B and C, and then D, E, F and G.
column B and C are drop down lists. C is dependent on the selection in column B.
Columns D, E, F and G are drop down lists. E is dependent on D, F dependent on E, G dependent on F.
When a selection is changed in column B, I need column C to go blank.
When the selection in D is changed, I need column E to go blank, and so on with the other dependent columns (F and G).
I will paste the code I am using below, but this is only for the second group of columns (D, E, F, G).
CODE FOR D, E, F and G.
Private Sub Worksheet_Change(ByVal Target As Range)
'Update by Extendoffice 2018/06/04
Application.EnableEvents = False
If Target.Column = 4 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 5 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 6 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
End Sub
When I add the text into the code for column B and C, I end up later getting the error I stated above. This is what the code looked like when I added in text for B and C
Private Sub Worksheet_Change(ByVal Target As Range)
'Update by Extendoffice 2018/06/04
Application.EnableEvents = False
If Target.Column = 2 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 4 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 5 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 6 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
End Sub
Can anyone help me with a new code please that wont give me this error?
Thank you!!
Situation; I have two groups of drop lists. B and C, and then D, E, F and G.
column B and C are drop down lists. C is dependent on the selection in column B.
Columns D, E, F and G are drop down lists. E is dependent on D, F dependent on E, G dependent on F.
When a selection is changed in column B, I need column C to go blank.
When the selection in D is changed, I need column E to go blank, and so on with the other dependent columns (F and G).
I will paste the code I am using below, but this is only for the second group of columns (D, E, F, G).
CODE FOR D, E, F and G.
Private Sub Worksheet_Change(ByVal Target As Range)
'Update by Extendoffice 2018/06/04
Application.EnableEvents = False
If Target.Column = 4 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 5 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 6 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
End Sub
When I add the text into the code for column B and C, I end up later getting the error I stated above. This is what the code looked like when I added in text for B and C
Private Sub Worksheet_Change(ByVal Target As Range)
'Update by Extendoffice 2018/06/04
Application.EnableEvents = False
If Target.Column = 2 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 4 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 5 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
Application.EnableEvents = False
If Target.Column = 6 And Target.Validation.Type = 3 Then
Target.Offset(0, 1).Value = ""
End If
Application.EnableEvents = True
End Sub
Can anyone help me with a new code please that wont give me this error?
Thank you!!