Long time lurker here, hoping to finally get some help on a lot of issues
I'm hoping I did my due dilligence and have exhausted ever search possible, but if not I'm sorry in advance.
The following code allows me to have a drop down list that fills in multiple fields once an option is selected. It works perfectly fine for fillig in one row at a time. However, if I try to fill down a row of information I get a run time error. This isn't an issue since everything gets filled down anyway, I just want to either prevent the error from poping up, or fix the code so there is no longer any error. Any help would be appreciated.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.DisplayAlerts = False
Dim FindMe As String
Dim Rng As Range
If Not Target.Column = 30 Then
Exit Sub
Else
FindMe = Target.Value
Set Rng = Sheets("Data").Range("Item_Code")
With Rng
Set Rng = .Find(What:=FindMe, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Target.Offset(0, 1).Value = Rng.Offset(0, 1).Value
Target.Offset(0, 3).Value = Rng.Offset(0, 2).Value
Target.Offset(0, 5).Value = Rng.Offset(0, 3).Value
Target.Offset(0, 6).Value = Rng.Offset(0, 4).Value
Target.Offset(0, 7).Value = Rng.Offset(0, 5).Value
End If
End With
End If
Application.DisplayAlerts = True
End Sub
Bookmarks