Codetempo mangelhaft
18.09.2006 16:36:50
Lorenz
Weiss vielleicht jemand eine bessere(schnellere) Lösung, da mit Variante A) mit der Schleife bis zu einer Minute braucht und
mit Variante B) das KopierMakro nur im ersten Blatt ausgeführt wird.
Variante A)
Private Sub CmdStatistik_Click()
Dim i As Integer
For i = 1 To 31
Sheets(i & ".").Select
Call KopierMakro
Next i
End Sub
Variante B)
Private Sub CmdStatistik_Click()
Worksheets(Array("1.", "2.", "3.", "4.", "5.", "6.", "7.", "8.", "9.", "10.", _
"11.", "12.", "13.", "14.", "15.", "16.", "17.", "18.", "19.", "20.", _
"21.", "22.", "23.", "24.", "25.", "26.", "27.", "28.", "29.", "30.", "31.")).Select
Call KopierMakro
End Sub
Sub KopierMakro()
Dim i As Integer, i2 As Integer
If Cells(4, 57).Value > 0 Then _
i = 57
i2 = i + 3
Range(Cells(100, i), Cells(100, i2)).Copy Destination:=Range(Cells(6, i), Cells(89, i2))
If Cells(4, 61).Value > 0 Then _
i = 61
i2 = i + 3
Range(Cells(100, i), Cells(100, i2)).Copy Destination:=Range(Cells(6, i), Cells(89, i2))
If Cells(4, 65).Value > 0 Then _
......
.........
End Sub
Gruss Lorenz