Change entries in a workbook

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

I have a workbook the I want excel to automatically move the entries to
another work book if it is over 2 years old

The cells will be

column A (date) Column b (comment)


Thanks in advance

Greg
 
Something like:

Dim i as Integer

For i = 500 to 1 step-1 'adj as needed
With Range("A" & i)
If.Value<Date-730 then '730 days ago
.Offset(0,1)).Copy _

Destination:=Workbooks("Workbook2").Sheets("Sheet1").Range("A65536").End(xlUp)(2)
.EntireRow.Delete 'optional
End if
End With
Next i
 
Not sure how to make this work, Does this way automatically search the
worksheet and then move them. When I copied the code it would not accept
the layout.

Sorry to be a pain

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top