Hi all,
With this Code I look into worksheet "DatenSpars". In this worksheet the columns a to m are filled with data.
If in column H is a date from today I need only the columns A, B, C, D, H, F, I from this lines and copy it
into worksheet "StopSuspend".
After that the lines have to be deleted in the worksheet "DatenSpars".
The only think what not work is the following line, where I select the needed cells:
.Range(.Cells(I, "A"), .Cells(I, "D"), .Cells(I, "H"), .Cells(I, "F"), .Cells(I, "I")).Copy Sheets("StopSuspend").Range("A" & Rows.Count).End(3)(2)
Hopefully someone could help?
I don't know what is wrong in this code?
Sub StopSuspend()
Dim I As Long, y
With Sheets("Daten Spars")
ReDim y(2 To 1000)
For I = LBound(y) To UBound(y)
If .Cells(I, "H") = Date Then
.Range(.Cells(I, "A"), .Cells(I, "D"), .Cells(I, "H"), .Cells(I, "F"), .Cells(I, "I")).Copy Sheets("StopSuspend").Range("A" & Rows.Count).End(3)(2)
End If
Next I
.Range(.Cells(1, "H"), .Cells(1000, "H")).AutoFilter 1, Date
On Error Resume Next
.Range(.Cells(2, "i"), .Cells(1000, "i")).SpecialCells(12).EntireRow.Delete
On Error GoTo 0
.AutoFilterMode = False
End With
End Sub
Best regards
Thorsten
Bookmarks