Hallo,
also mal angefangen von Spalte U bis W. Nach diesem Muster wirst du den Rest hoffentlich selbst hinbringen:
Public Sub FormelnSchreiben1()
Dim lnglastZ As Long, lnglastS As Long, a As Long
Dim oBlatt As Worksheet
Set oBlatt = ThisWorkbook.Worksheets("Sheet1") 'Tabellennamen gg. anpassen
With oBlatt
lnglastS = .Cells(1, Columns.Count).End(xlToLeft).Column
lnglastZ = .Cells(Rows.Count, lnglastS).End(xlUp).Row + 1
For a = 2 To lnglastZ
.Cells(a, 21).Formula = "=K" & a & "*R" & a
Next
End With
With oBlatt
lnglastZ = .Cells(Rows.Count, lnglastS).End(xlUp).Row + 1
For a = 2 To lnglastZ
.Cells(a, 22).Formula = "=K" & a & "-VLOOKUP('02-2020'!C" & a & ",'02-2020'!C" & a & ":K80,2,FALSE)"
Next
End With
With oBlatt
lnglastZ = .Cells(Rows.Count, lnglastS).End(xlUp).Row + 1
For a = 2 To lnglastZ
.Cells(a, 23).Formula = "=ROUND(VLOOKUP('02-2020'!A" & a & ",'Mietpreisliste aktuell'!$A$1:$H$480,8,FALSE),4)"
Next
End With
Set oBlatt = Nothing
End Sub
Gruss Torsten
|