I made minor change to the code and now it's not working. I need the "data" entry part to be run from a different worksheet.
Private Sub UserForm_Initialize()
Dim r As Range, adr As String, lookupwksht As Worksheet
Set lookupwksht = ActiveWorkbook.Sheets("Contiguous")
With lookupwksht.Range("A2", Cells(Rows.Count, 1).End(xlUp))
Set r = .Find(What:=s, LookAt:=xlWhole)
If Not r Is Nothing Then
adr = r.Address
Do
Me.ComboBox1.AddItem r(1, 2).Value
Set r = .FindNext(r)
Loop While r.Address <> adr
End If
End With
Me.ComboBox1.ListIndex = 0
End Sub
I am getting the error message. Methon 'Range' of object '_Worksheet' failed...
Bookmarks