Range auswäheln mit do loop
alex
kann mir jemand sagen, wie ich den Bereich von DatumA - DatumE markiere?
Private Sub CommandButton1_Click()
Dim DatumA As Date
Dim DatumE As Date
Dim IntZeile As Integer
IntZeile = 1
' DatumAnfang
Do While Worksheets("Tabelle1").Cells(IntZeile, 1) Date
IntZeile = IntZeile + 1
Cells(2, 7) = Worksheets("Tabelle1").Cells(IntZeile, 1)
Cells(2, 8) = Worksheets("Tabelle1").Cells(IntZeile, 2)
Cells(2, 9) = Worksheets("Tabelle1").Cells(IntZeile, 3)
DatumA = Worksheets("Tabelle1").Cells(IntZeile, 1)
Loop
' DatumEnde
Do While Worksheets("Tabelle1").Cells(IntZeile, 1) Date + 5
IntZeile = IntZeile + 1
Cells(3, 7) = Worksheets("Tabelle1").Cells(IntZeile, 1)
Cells(3, 8) = Worksheets("Tabelle1").Cells(IntZeile, 2)
Cells(3, 9) = Worksheets("Tabelle1").Cells(IntZeile, 3)
DatumE = Worksheets("Tabelle1").Cells(IntZeile, 1)
Loop
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
End Sub
Vielen Dank
... sehe vor lauter Bäumen langsam kein Wald mehr
Gruß
Alex