Ik wil in de volgende code een MsgBox toevoegen, maar ik weet niet waar ik deze moet plaatsen. Deze MsgBox:
moet toegevoegd worden in de volgende code:
Code:
If zoekopnaamfiliaal Is Nothing and zoekopnaamplaats is Nothing Then
MsgBox "Filiaal bestaat niet"
End If
Code:
Private Sub zoekopnaamzoek_Click()
Dim c As Range, filteredRange As Range
With Sheets("database filiaal").Range("B4").CurrentRegion
.AutoFilter
.AutoFilter Field:=1, Criteria1:=zoekopnaamfiliaal.Text
.AutoFilter Field:=3, Criteria1:=zoekopnaamplaats.Value
End With
With Sheets("database filiaal").AutoFilter.Range
On Error Resume Next
Set filteredRange = .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible)
End With
For Each c In Intersect(filteredRange, Sheets("database filiaal").Columns(6))
zoekenopnaam.zoekopnaamfiliaalnr.AddItem c
Next
End Sub
Laatst bewerkt: