wanneer ik de regel wil opslaan komt kortstondig het bestand op de voorgrond.
het sluit wel automatisch af maar ik wil het bestand eigenlijk geheel niet zien.
het sluit wel automatisch af maar ik wil het bestand eigenlijk geheel niet zien.
Code:
Private Sub ComboBox4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim f As Range, Wb As Worksheet, msg As Long
msg = MsgBox("Ja is toevoegen, Nee is Verwijderen?", vbCritical + vbYesNoCancel)
Application.DisplayAlerts = False
If msg <> vbNo And msg <> vbYes Then
Exit Sub
Else: End If
With Workbooks.Open("C:\Dropbox\documenten\Excel omschrijving.xlsm").Sheets("blad2")
If msg = vbYes And ComboBox4.ListIndex = -1 Then
.Cells(Rows.Count, 1).End(xlUp).Offset(1) = ComboBox4.Value
.Range("A3:A" & .Cells(Rows.Count, 1).End(xlUp).Row).Sort .Range("A3")
ElseIf msg = vbNo Then
Set f = .Columns(1).Find(ComboBox4.Value, , , 1)
If Not f Is Nothing Then .Rows(f.Row).Delete
End If
.Parent.Close -1
Application.DisplayAlerts = True
End With
End Sub