View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Delete rows from outside of Excel application

A starter

set xlApp = GetObject(,"Excel.Application")
with xlapp.Activesheet
cLastRow = .Cells(.Rows.Count,"D").End(xlUp).Row
For i = cLastRow To 1 Step -1
if .Cells(i,"D").Value = Date Then
.Cells(i,"D").Entirerow.Delete
End If
Next i
End With


--

HTH

RP
(remove nothere from the email address if mailing direct)


"dar" wrote in message
...
I have a workbook with several worksheets each containing Column D as a

Date.
I need to be able to delete any rows with a date earlier than Now(). I
would like to be able to do that from Access if possible.
If I need to add a control to Excel, please include code for that

control.

Thank you.