ActiveCell.FormulaR1C1 = "=RC[-1]"
20.03.2018 12:33:58
Andreas
hätte mal wieder eine Frage.
Wie kann ich folgenden Code kürzer gestalten. (nur einen Block reinkopiert)
Hab schon rumprobiert aber bin mit meinem sehr bescheidenen VBA Latein am Ende.
Dieser Code soll folgendes bewirken:
In Zelle AK13 steht einfach =AJ13 (nötig für eine Berechnung)
wenn jemand diesen Bezug ändert (in meinem Fall durchaus möglich) soll über das
Makro wieder das =AJ13 stehen, usw.
Jetzt habe ich aber in einem Tabellenblatt 15 Druckbereiche und in jedem Druckbereich
55 Zellen über das Makro zu ändern, sprich 825 Zellen.
Da schreit jetzt der VBA Editor "Prozedur zu groß".
Bin mir sicher ihr könnt mir einen Rat geben.
Vielen Dank
LG Andi
'Ma 02
Range("AK13").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK14").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK15").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK16").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK17").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK18").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK19").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK20").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK21").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK22").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK23").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK24").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK25").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK26").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK27").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK28").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK29").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK30").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK31").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK32").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK33").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK34").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK35").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK36").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK37").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK38").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK39").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK40").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK41").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK42").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK43").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK44").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK45").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK46").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK47").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK48").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK49").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK50").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK51").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK52").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK53").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK54").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK55").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK57").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK58").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK59").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK60").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK61").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK62").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK63").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK64").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK65").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK66").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK67").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"
Range("AK68").Select
Selection.ClearContents
ActiveCell.FormulaR1C1 = "=RC[-1]"