Hallo freunde.......Ich bin erst seit kurzem in die Welt der makros eingetreten ......:-)
Ich habe ein Makro erstellt für ein 13. tabellenblatt....und das war schon schwierig genug für mich......:-(
jetzt soll ich zur krönung, aus dem Tabellen blatt 13 ein variable mit x=13 machen damit sich beim Nächsten Tabellenblatt 14 einfach das makro von Tabellenblatt 13 genommen werden kann und x=13 mit x=14 ersetzt wird
hier das makro mir bezug auf tabellenblatt 13
Sub makromaerz_14()
'
' makromaerz_14 Makro
' Makro am 14.03.2008 von bmarjan aufgezeichnet
'
' Tastenkombination: Strg+y
'
Range("A32:AD38").Select
Selection.Copy
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollRow = 19
ActiveWindow.ScrollRow = 20
ActiveWindow.ScrollRow = 21
ActiveWindow.ScrollRow = 22
ActiveWindow.ScrollRow = 26
ActiveWindow.ScrollRow = 27
ActiveWindow.ScrollRow = 33
ActiveWindow.ScrollRow = 34
ActiveWindow.ScrollRow = 35
Range("A88:AD95").Select
ActiveSheet.Paste
Range("A88").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "='13'!R1C1"
Range("A89").Select
ActiveCell.FormulaR1C1 = "='13'!R1C2"
Range("A90").Select
ActiveCell.FormulaR1C1 = "='13'!R1C4"
Range("A91").Select
ActiveCell.FormulaR1C1 = "='13'!R1C6"
Range("A92").Select
ActiveCell.FormulaR1C1 = "='13'!R1C8"
Range("A93").Select
ActiveCell.FormulaR1C1 = "='13'!R1C10"
Range("A94").Select
ActiveCell.FormulaR1C1 = "='13'!R1C12"
Range("B89").Select
ActiveCell.FormulaR1C1 = "='13'!R2C2"
Range("B90").Select
ActiveCell.FormulaR1C1 = "='13'!R2C4"
Range("B91").Select
ActiveCell.FormulaR1C1 = "='13'!R2C6"
Range("B92").Select
ActiveCell.FormulaR1C1 = "='13'!R2C8"
Range("B93").Select
ActiveCell.FormulaR1C1 = "='13'!R2C10"
Range("B94").Select
ActiveCell.FormulaR1C1 = "='13'!R2C12"
Range("C91").Select
ActiveCell.FormulaR1C1 = ""
Range("C92").Select
ActiveCell.FormulaR1C1 = ""
Range("C93").Select
ActiveCell.FormulaR1C1 = ""
Range("D89").Select
ActiveCell.FormulaR1C1 = ""
Range("D90").Select
ActiveCell.FormulaR1C1 = ""
Range("D91").Select
ActiveCell.FormulaR1C1 = ""
Range("D92").Select
ActiveCell.FormulaR1C1 = ""
Range("F89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R7C3="""",'13'!R7C2,'13'!R7C3)"
Range("F91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R7C7="""",'13'!R7C6,'13'!R7C7)"
Range("F92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R7C9="""",'13'!R7C8,'13'!R7C9)"
Range("F93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R7C11="""",'13'!R7C10,'13'!R7C11)"
Range("F94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R7C13="""",'13'!R7C12,'13'!R7C13)"
Range("H89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R8C3="""",'13'!R8C2,'13'!R8C3)"
Range("H90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R8C5="""",'13'!R8C4,'13'!R8C5)"
Range("H91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R8C7="""",'13'!R8C6,'13'!R8C7)"
Range("H92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R8C9="""",'13'!R8C8,'13'!R8C9)"
Range("H93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R8C11="""",'13'!R8C10,'13'!R8C11)"
Range("H94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R8C13="""",'13'!R8C12,'13'!R8C13)"
Range("J89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R9C3="""",'13'!R9C2,'13'!R9C3)"
Range("J90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R9C5="""",'13'!R9C4,'13'!R9C5)"
Range("J91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R9C7="""",'13'!R9C6,'13'!R9C7)"
Range("J92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R9C9="""",'13'!R9C8,'13'!R9C9)"
Range("J93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R9C11="""",'13'!R9C10,'13'!R9C11)"
Range("J94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R9C13="""",'13'!R9C12,'13'!R9C13)"
Range("L89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R10C3="""",'13'!R10C2,'13'!R10C3)"
Range("L90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R10C5="""",'13'!R10C4,'13'!R10C5)"
Range("L91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R10C7="""",'13'!R10C6,'13'!R10C7)"
Range("L92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R10C9="""",'13'!R10C8,'13'!R10C9)"
Range("L93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R10C11="""",'13'!R10C10,'13'!R10C11)"
Range("L94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R10C13="""",'13'!R10C12,'13'!R10C13)"
Range("L95").Select
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
Range("N89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R11C3="""",'13'!R11C2,'13'!R11C3)"
Range("N90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R11C5="""",'13'!R11C4,'13'!R11C5)"
Range("N91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R11C7="""",'13'!R11C6,'13'!R11C7)"
Range("N92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R11C9="""",'13'!R11C8,'13'!R11C9)"
Range("N93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R11C11="""",'13'!R11C10,'13'!R11C11)"
Range("N94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R11C13="""",'13'!R11C12,'13'!R11C13)"
Range("P89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R12C3="""",'13'!R12C2,'13'!R12C3)"
Range("P90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R12C5="""",'13'!R12C4,'13'!R12C5)"
Range("P91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R12C7="""",'13'!R12C6,'13'!R12C7)"
Range("P92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R12C9="""",'13'!R12C8,'13'!R12C9)"
Range("P93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R12C11="""",'13'!R12C10,'13'!R12C11)"
Range("P94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R12C13="""",'13'!R12C12,'13'!R12C13)"
Range("P95").Select
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 9
Range("R89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R13C3="""",'13'!R13C2,'13'!R13C3)"
Range("R90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R13C5="""",'13'!R13C4,'13'!R13C5)"
Range("R91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R13C7="""",'13'!R13C6,'13'!R13C7)"
Range("R92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R13C9="""",'13'!R13C8,'13'!R13C9)"
Range("R93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R13C11="""",'13'!R13C10,'13'!R13C11)"
Range("R94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R13C13="""",'13'!R13C12,'13'!R13C13)"
Range("T89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R14C3="""",'13'!R14C2,'13'!R14C3)"
Range("T90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R14C5="""",'13'!R14C4,'13'!R14C5)"
Range("T91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R14C7="""",'13'!R14C6,'13'!R14C7)"
Range("T92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R14C9="""",'13'!R14C8,'13'!R14C9)"
Range("T93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R14C11="""",'13'!R14C10,'13'!R14C11)"
Range("T94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R14C13="""",'13'!R14C12,'13'!R14C13)"
Range("T95").Select
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 12
Range("V89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R15C3="""",'13'!R15C2,'13'!R15C3)"
Range("V90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R15C5="""",'13'!R15C4,'13'!R15C5)"
Range("V91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R15C7="""",'13'!R15C6,'13'!R15C7)"
Range("V92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R15C9="""",'13'!R15C8,'13'!R15C9)"
Range("V93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R15C11="""",'13'!R15C10,'13'!R15C11)"
Range("V94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R15C13="""",'13'!R15C12,'13'!R15C13)"
Range("V95").Select
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 14
Range("X89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R16C3="""",'13'!R16C2,'13'!R16C3)"
Range("X90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R16C5="""",'13'!R16C4,'13'!R16C5)"
Range("X91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R16C7="""",'13'!R16C6,'13'!R16C7)"
Range("X92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R16C9="""",'13'!R16C8,'13'!R16C9)"
Range("X93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R16C11="""",'13'!R16C10,'13'!R16C11)"
Range("X94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R16C13="""",'13'!R16C12,'13'!R16C13)"
Range("X95").Select
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 17
Range("Z89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R17C3="""",'13'!R17C2,'13'!R17C3)"
Range("Z90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R17C5="""",'13'!R17C4,'13'!R17C5)"
Range("Z91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R17C7="""",'13'!R17C6,'13'!R17C7)"
Range("Z92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R17C9="""",'13'!R17C8,'13'!R17C9)"
Range("Z93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R17C11="""",'13'!R17C10,'13'!R17C11)"
Range("Z94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R17C13="""",'13'!R17C12,'13'!R17C13)"
Range("AB89").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R18C3="""",'13'!R18C2,'13'!R18C3)"
Range("AB90").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R18C5="""",'13'!R18C4,'13'!R18C5)"
Range("AB91").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R18C7="""",'13'!R18C6,'13'!R18C7)"
Range("AB92").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R18C9="""",'13'!R18C8,'13'!R18C9)"
Range("AB93").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R18C11="""",'13'!R18C10,'13'!R[9]C[-23])"
Range("AB94").Select
ActiveCell.FormulaR1C1 = "=IF('13'!R18C11="""",'13'!R18C10,'13'!R[9]C[-23])"
Range("AB95").Select
ActiveWindow.ScrollColumn = 18
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 11
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("D93").Select
ActiveCell.FormulaR1C1 = ""
Range("D94").Select
ActiveCell.FormulaR1C1 = ""
Range("D89").Select
End Sub
hoffe ihr könnt mir helfen.......:-) |