AW: VBA Code für Formel in Zeile C
29.01.2008 17:45:00
Fred
Hallo Cris
Vielen Dank für Deine Antwort, klappt wirklich prima.Leider Habe ich jetzt sofort das nächste Problem, Dein Code verhindert leider meinen Code Der Darunter steht. . Leider werden meine UF jezt nicht mehr angezeigt. was müsste mann ändern damit beide Codes funktionieren
Private Sub Worksheet_Change(ByVal Target As Range)
Dim reihe As Long
If Target.Row 2 Or Target.Value = "" Then
Exit Sub
End If
If Target.Column = 2 And Target.Row >= 4 Then
reihe = Target.Row
If Range("A" & reihe) = "" Then
MsgBox "Geben Sie erst die Anfangszeit ein!", vbExclamation, "Eingabereihenfolge"
Range("B" & reihe).ClearContents
Exit Sub
Else
If Range("B" & reihe) "" Then
Range("C" & reihe).FormulaR1C1 = "=MOD(RC[-1]-RC[-2],1)"
End If
End If
End If
Dieser Code Läuft jetzt nicht mehr
If Intersect(Target, Range("D4:D100")) Is Nothing Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
Select Case Target.Value
Case 2
Mechanisch.Show
Dim iRow As Integer
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "MA"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 9
Material.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "BWW"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 1
Elektrisch.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "EL"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 5
Produktionsbetrieb.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "BWK"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 6
Prozessrechner.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "BDE"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 10
Stofffluss.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "PRL"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 11
Transport.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "Kran"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case "9/19"
UserForm0.Show
Case 13
ÄußereEinwirkungen.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "sonst"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 14
Belegschaft.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "BWK"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 15
Versuche.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "sonst"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 16
Walzenwechsel.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "ung."
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 17
NichtBeschriebeneGründe.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "ung."
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case 51
Nutzungsnebenzeit.Show
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 5).Value = "Rüst"
iRow = Cells(Rows.Count, 1).End(xlUp).Row + 0
Cells(iRow, 6).Value = "BWK"
Case Else
End Select
End Sub