Code bricht nicht ab bei MsgBox
30.12.2014 18:51:03
Heinz H
Hallo Leute
Im unteren Code kann ich Daten eintragen usw..
Nun habe ich eine MsgBox zum anhalten eingebaut,wenn das Datum im Sheets "311" nicht eingetragen ist.
Nur läuft die Fehlermeldung weiter.
Ich möchte doch bei MsgBox den Code anhalten.
Hätte dazu jemand eine Hilfestellung?
Gruß,Heinz
Private Sub UserForm_Initialize()
Dim MyArray As Variant
Dim lIndx As Long
Dim oDic As Object
Dim lIndxA As Long ' For/Next Index - außen
Dim lIndxI As Long ' For/Next Index - innen
Dim sTemp As String ' temporärer Zwischenspeicher
With ThisWorkbook.Worksheets("Schicht AF")
MyArray = .Range("A2:A" & .Cells(.Rows.Count, 1).End(xlUp).Row)
End With
Set oDic = CreateObject("Scripting.Dictionary")
For lIndx = 1 To UBound(MyArray)
If MyArray(lIndx, 1) <> "" Then
oDic(MyArray(lIndx, 1)) = 0
End If
Next lIndx
With ComboBoxDatum
.Style = 2
.List = Application.Transpose(oDic.keys)
End With
ComboBoxSchicht.AddItem 1
ComboBoxSchicht.AddItem 2
ComboBoxSchicht.AddItem 3
If Sheets("Schicht AF").Range("A2").Value > Date Then
MsgBox "Sie können die Datei erst ab " & Sheets("311").Range("A2") & " " & "benutzen"
Exit Sub
End If
ComboBoxDatum = Date - 1 'Datum von gestern
'hier kannste wieder automatisch einlesen
Call ComboboxList_Blattnamen_FehlerLinie 'im Modul1 neu!
With ComboBoxgemeldetHE
.AddItem "Ja"
.AddItem "Nein"
.AddItem ""
End With
With ComboBoxVerdacht
.AddItem "Ja"
.AddItem "Nein"
.AddItem ""
End With
With ComboBoxUmbau
.AddItem "Ja"
.AddItem "Nein"
.AddItem ""
End With
With ComboBoxwie_oft
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem ""
End With
End Sub