Thema Datum  Von Nutzer Rating
Antwort
24.04.2017 13:25:54 Fokus
NotSolved
24.04.2017 14:27:22 Gast67735
NotSolved
24.04.2017 15:04:23 Fokus
NotSolved
24.04.2017 16:44:04 Gast55034
NotSolved
25.04.2017 10:54:58 Fokus
NotSolved
Blau Betriebszustand überprüfen
25.04.2017 11:00:02 Fokus
NotSolved
25.04.2017 19:20:43 Gast94848
NotSolved
04.05.2017 08:46:18 Gast77528
NotSolved
04.05.2017 08:46:40 Fokus
NotSolved
11.05.2017 17:12:46 Fokus
NotSolved
11.05.2017 18:02:02 Gast98626
*****
Solved
11.05.2017 19:29:09 Fokus
NotSolved
15.05.2017 11:36:07 Fokus
NotSolved
15.05.2017 12:42:22 Gast24116
NotSolved
15.05.2017 13:03:07 Fokus
NotSolved
15.05.2017 13:18:17 Fokus
NotSolved
15.05.2017 14:45:28 Gast96727
NotSolved
15.05.2017 14:45:29 Gast94987
Solved
15.05.2017 15:55:11 Fokus
NotSolved

Ansicht des Beitrags:
Von:
Fokus
Datum:
25.04.2017 11:00:02
Views:
832
Rating: Antwort:
  Ja
Thema:
Betriebszustand überprüfen
Hallo Leute!
Hier der ganze Code....nach dem Einfügen von den verschiedenen Fällen wird die erste Zeile markiert mit dem Debugger: Sub oder Function nicht definiert.
 

Private Sub Eingeben_Click()

'wenn die ComboBox nicht leer ist, wird nur die Nummer eingetragen

    If cbxBZ <> 0 Then
            A = Left(cbxBZ, 2)
            If A = "1 -" Then
            A = Left(A, 1)
            End If
            
            If A = "2 -" Then
            A = Left(A, 1)
            End If
            
            If A = "3 -" Then
            A = Left(A, 1)
            End If
            
            If A = "4 -" Then
            A = Left(A, 1)
            End If
            
    End If
    
'Betriebszustand in die Spalte F übertragen

     If cbxBZ <> 0 Then
            b = Mid(cbxBZ, 6, 50)
        
    End If
    
 Dim indikator As String
 
 'Überprüfen von Länge der Nummern, der Menge und Kommentar
 
        indikator = False
        If indikator <> True Then
            If A = 11 Then
                Dim lange As Integer
                    lange = Len(txtSAP)
                If lange <> 7 Then
                    MsgBox "Die SAP-Nummer ist NICHT richtig. Bitte überprüfen Sie diese!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
                
                Dim lange2 As Integer
                    lange2 = Len(txtLOT)
                If lange2 <> 9 Then
                    MsgBox "Die Chargen-Nummer ist NICHT richtig. Bitte überprüfen Sie diese!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
                     
            End If
            
            If A = 14 Then
                If txtSonstiges = "" Then
                    MsgBox "Bitte fügen Sie eine sonstige Erklärung hinzu!", vbOKOnly + vbExclamation, "Meldung"
                    Exit Sub
                End If
            End If
        
            
            indikator = True
            
        End If


'Überprüfen, welcher Betriebszustand als letztes angegeben wurde
 
Dim z As Long
Dim letzte As Long
letzte = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
E = ActiveSheet.Cells(letzte, 15).Value  'Spalte O
 
For z = letzte To z = letzte - 2
        Select Case A
            Case 11
            If E <> "35" Or E <> "14" Or E <> "2*" Then
                MsgBox "Bitte den Turm anfahren!", vbOKOnly + vbCritical, "Meldung"
                txtLOT = ""
                txtSAP = ""
                Exit Sub
            End If
 
            Case 12, 13
             
                If E <> "36" Or E <> "14" Or E <> "4*" Or E <> "2*" Then
                    MsgBox "Bitte den Turm ausfahren!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
                 
            Case 15
                     
                If E <> "36" Or E <> "1*" Or E <> "4*" Or E <> "2*" Then
                    MsgBox "Bitte den Turm ausfahren!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
             
            Case 31, 32, 33, 34
             
                If E <> "36" Or E <> "14" Or E <> "2*" Then
                    MsgBox "Bitte den Turm ausfahren!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
                 
            Case 35
                 
                If E <> "36" Or E <> "14" Or E <> "4*" Or E <> "31" Or E <> "2*" Then
                    MsgBox "Bitte den letzten Betriebszustand überprüfen!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
             
            Case 36
             
                If E <> "11" Or E <> "14" Or E <> "2*" Then
                    MsgBox "Bitte den letzten Betriebszustand überprüfen!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
       
            Case 41
             
                If E <> "33" Then
                    MsgBox "Bitte auf CIP Komplett umbauen!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
       
            Case 42
                If E <> "34" Then
                    MsgBox "Bitte auf CIP Komplett mit Filterkammer umbauen!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
     
            Case 43, 44
     
                If E <> "32" Then
                    MsgBox "Bitte auf CIP Leitung umbauen!", vbOKOnly + vbCritical, "Meldung"
                    Exit Sub
                End If
            Case Else
 
        End Select
Next z


If indikator = True Then

    Dim intErsteleereZeile As Long

    'Fügt die eingetragenen Werte ins Tabellenblatt und schließt das Turmprotokollfenster (me=frmTurmprotokoll)

    With ActiveSheet

         intErsteleereZeile = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
     
                .Cells(intErsteleereZeile, 3).Value = Me.txtDatum.Value
                .Cells(intErsteleereZeile, 4).Value = Me.txtUhrzeit.Value
                .Cells(intErsteleereZeile, 5).Value = A
                .Cells(intErsteleereZeile, 6).Value = b
                .Cells(intErsteleereZeile, 7).Value = Me.txtLOT.Value
                .Cells(intErsteleereZeile, 9).Value = Me.txtSAP.Value
                .Cells(intErsteleereZeile, 14).Value = Me.txtSonstiges.Value
                
                Dim y As Integer
                  y = Year(Date)
                  .Cells(intErsteleereZeile, 2).Value = y
                  
    End With
End If

'Spalte A automatisch fortführen, auf Datum+Uhrzeit formatieren

Dim lngLastRow As Long
Dim lngCounter As Long

Application.ScreenUpdating = True
' letzte Zeile ohne Unterbrechung in Spalte C feststellen

lngLastRow = Range("C1").End(xlDown).Row

For lngCounter = lngLastRow - 2 To lngLastRow
 Cells(lngCounter, 1).Formula = "=(" & Cells(lngCounter, 3).Address & "+" & Cells(lngCounter, 4).Address & ")"
 Range("A:A").NumberFormat = "m/d/yyyy h:mm"
 
Next lngCounter
Application.ScreenUpdating = True

'Vergleich der H Spalte mit der G Spalte

Dim wb As Workbook
Set wb = Workbooks("Turmprotokoll_v5")

Dim t1 As Worksheet
Set t1 = Worksheets("Tabelle1")

Dim i As Integer 'Laufvariable für die Zeile
Dim Ubertrag As Long 'Werte Übertragen


i = 2

    If i = 2 Then
    t1.Cells(i, 8) = t1.Cells(i, 7).Value
    i = i + 1
    
    Else
    t1.Cells(i, 8) = ""
    i = i + 1
    
    End If


Do While t1.Cells(i, 1) <> ""

    If t1.Cells(i, 7) <> "" Then
    
    
     Ubertrag = t1.Cells(i, 7).Value
     t1.Cells(i, 8) = Ubertrag
        
    Else
        
        Ubertrag = t1.Cells(i - 1, 8).Value
        t1.Cells(i, 8) = Ubertrag
        
    End If

    i = i + 1
    
Loop

'SVerweis für Spalte J

Dim zl As Long, lz As Long, s As Integer
lz = Range("A65536").End(xlUp).Row
If Range("A65536") <> "" Then lz = 65536

On Error Resume Next
For zl = 1 To lz 'Zeilen                                                                                      
    For s = 46 To 46
        Cells(zl, s).Value = WorksheetFunction.VLookup(Cells(zl, 1).Value, Range("Matrix"), s, False)
        If Err.Number > 0 Then
            Err.Clear
            Cells(zl, s) = "#NV!"
        End If
            
    Next s
Next zl


 Unload frmTurmprotokoll
End Sub



Danke für eure Hilfe!

VG


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
24.04.2017 13:25:54 Fokus
NotSolved
24.04.2017 14:27:22 Gast67735
NotSolved
24.04.2017 15:04:23 Fokus
NotSolved
24.04.2017 16:44:04 Gast55034
NotSolved
25.04.2017 10:54:58 Fokus
NotSolved
Blau Betriebszustand überprüfen
25.04.2017 11:00:02 Fokus
NotSolved
25.04.2017 19:20:43 Gast94848
NotSolved
04.05.2017 08:46:18 Gast77528
NotSolved
04.05.2017 08:46:40 Fokus
NotSolved
11.05.2017 17:12:46 Fokus
NotSolved
11.05.2017 18:02:02 Gast98626
*****
Solved
11.05.2017 19:29:09 Fokus
NotSolved
15.05.2017 11:36:07 Fokus
NotSolved
15.05.2017 12:42:22 Gast24116
NotSolved
15.05.2017 13:03:07 Fokus
NotSolved
15.05.2017 13:18:17 Fokus
NotSolved
15.05.2017 14:45:28 Gast96727
NotSolved
15.05.2017 14:45:29 Gast94987
Solved
15.05.2017 15:55:11 Fokus
NotSolved