Anbei die originale Formel, sie ist doch ein wenig komplexer. Sie funktioniert, bis auf das Makro aufrufen über par1.
Sub Prüfung_Berechnung(par1, par2, par3, par4, par5, par6, par7, par8 As String)
With Worksheets("Sheet1")
If .Range("KX5").Value = 1440 Then
For s = .Range("LA1").Column To .Range("BOJ1").Column
For s2 = .Range("BQC1").Column To .Range("DTL1").Column
If .Cells(10, s).Value > "" Then
.Cells(par6, s2).Value = .Cells(10, s).Value
End If
Next
Next
For s = .Range("LA1").Column To .Range("BOJ1").Column
For s2 = .Range("BQC1").Column To .Range("DTL1").Column
If .Cells(12, s).Value > "" Then
.Cells(par7, s2).Value = .Cells(12, s).Value
End If
Next
Next
For s = .Range("LA1").Column To .Range("BOJ1").Column
For s2 = .Range("BQC1").Column To .Range("DTL1").Column
If .Cells(13, s).Value > "" Then
.Cells(par8, s2).Value = .Cells(13, s).Value
End If
Next
Next
For s2 = .Range("BQC1").Column To .Range("DTL1").Column
If .Cells(1, s2).Value >= .Range(par2).Value And _
.Cells(1, s2).Value <= .Range(par3).Value And _
.Cells(par7, s2).Value = "" Then
.Cells(par4, s2).Value = 1
Else
.Cells(par4, s2).Value = 0
End If
Next
Call Auftrag_Ende
Else: Call par1
End If
End With
End Sub
|