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:
1046
Rating: Antwort:
  Ja
Thema:
Betriebszustand überprüfen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
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