ramnewbietoaccess
Programmer
In Excel 2000 I have rows whereby columns a and b are populated by a selection from a listbox in a user form. Columns c:n are then populated manually. I would like the entire row to clear if the contents from column a are deleted just for user friendliness. I am using the following code.
My question is this. The code works great SOMETIMES and other times it doesnt work at all. Is there a reason this would be unstabile?
And also, is there a better suggestion or an improved suggestion to accomplish this?
Thank you in advance.
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Column > 1 Then Exit Sub
If .Row < 7 Then Exit Sub
Application.EnableEvents = False
If .Value = "" Then .Offset(0, 1).Value = ""
If .Value = "" Then .Offset(0, 2).Value = ""
If .Value = "" Then .Offset(0, 3).Value = ""
If .Value = "" Then .Offset(0, 4).Value = ""
If .Value = "" Then .Offset(0, 6).Value = ""
If .Value = "" Then .Offset(0, 7).Value = ""
End If
End Sub
My question is this. The code works great SOMETIMES and other times it doesnt work at all. Is there a reason this would be unstabile?
And also, is there a better suggestion or an improved suggestion to accomplish this?
Thank you in advance.
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Column > 1 Then Exit Sub
If .Row < 7 Then Exit Sub
Application.EnableEvents = False
If .Value = "" Then .Offset(0, 1).Value = ""
If .Value = "" Then .Offset(0, 2).Value = ""
If .Value = "" Then .Offset(0, 3).Value = ""
If .Value = "" Then .Offset(0, 4).Value = ""
If .Value = "" Then .Offset(0, 6).Value = ""
If .Value = "" Then .Offset(0, 7).Value = ""
End If
End Sub