Open Excel & Loop thru wksh

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I honestly can't remember if I asked in this format, however:
I have Access 2000, with Excel on a Shared Drive.
I need to open a specific wkbk "ClinicTECList.xlx" on the N: drive
I need to be able to loop through the 9 wksh and go to Column D and delete any
row (s) that have a Date earlier than today.
Most importantly, I NEED HELP in the coding, down to the basics.

Help would be appreciated.
 
I need to open a specific wkbk "ClinicTECList.xlx" on the N: drive
I need to be able to loop through the 9 wksh and go to Column D and
delete any row (s) that have a Date earlier than today.
Most importantly, I NEED HELP in the coding, down to the basics.

You are probably better off asking in an Excel coding group: even if you
want to use OLE automation, the code uses the same Excel object model.

Off the top of my head, it'll be something along the lines of

For each wks in wbk.Worksheets
For each rng in wks.UsedRange.Rows
If rng.Cells(4).Value < Date() then
rng.Delete
End If
Next rng
Next wks


but I can think of half a dozen potential errors in that, which need to be
tested. Ask the Excel programmers.

All the best


Tim F
 
Back
Top