two sheets copying information

  • Thread starter Thread starter That's Confidential
  • Start date Start date
T

That's Confidential

I have two sheets in a file. In each row of the first sheet, I have
information, with a date inputted in the cell of that row in column K. Now,
what I want is for, five days after the date in the cell in K, I would like
the info to be deleted from the sheet and copied over to sheet number 2.
Now, I would like all the rows in sheet 1 to move up a line otherwise there
will be spaces.

Any hints?
 
You need a macro such as the following:

Sub MoveToSheet2After5Days()
Dim c As Range
With Sheet1
For Each c In Intersect(.UsedRange, .Columns("K"))
If IsDate(c) Then
If Date - c >= 5 Then
c.EntireRow.Copy Sheet2.UsedRange(1,
1).Offset(1).EntireRow
c.EntireRow.Delete
End If
End If
Next
End With
End Sub
 
Back
Top