Code schneller?
20.07.2016 13:15:25
Tim
kann man diesen Code schneller machen?:
Sub Test()
Range("A4") = "=IF(AND('Daten aus CS7'!R[-2]C="""",'Daten aus CS7'!R[-2]C=0),"""",'Daten aus _
CS7'!R[-2]C)"
Range("B4") = "=IF(RC[-1]="""","""",IFERROR(VLOOKUP(RC[5],'Daten aus SAP '!C[-1]:C[2],2, _
FALSE),""Daten prüfen""))"
Range("C4") = "=IF('Daten aus CS7'!R[-2]C[4]="""","""",'Daten aus CS7'!R[-2]C[4])"
Range("D4") = "=IF('Daten aus CS7'!R[-2]C[4]="""","""",'Daten aus CS7'!R[-2]C[4])"
Range("E4") = "=IF(RC[-4]="""","""",IFERROR(VLOOKUP(RC[2],'Daten aus SAP '!C[-4]:C[-1],4, _
FALSE),""Daten prüfen""))"
Range("F4") = "=IF(RC[-5]="""","""",IFERROR(VLOOKUP(RC[1],'Daten aus SAP '!C[-5]:C[-2],3, _
FALSE),""Daten prüfen""))"
Range("G4") = "=IF('Daten aus CS7'!R[-2]C[-4]="""","""",'Daten aus CS7'!R[-2]C[-4])"
Range("H4") = "=IF('Daten aus CS7'!R[-2]C[-3]="""","""",'Daten aus CS7'!R[-2]C[-3])"
Range("I4") = "=IF('Daten aus CS7'!R[-2]C="""","""",'Daten aus CS7'!R[-2]C)"
Range("A4:I4").AutoFill Destination:=Range("A4:I" & Cells(Rows.Count, "A").End(xlUp).Row), _
Type:=xlFillDefault
Columns("A:I").Select
Range("I2").Activate
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
Range("A4").Select
End Sub
Besten DankTIM