View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Baxter Jay Baxter is offline
external usenet poster
 
Posts: 12
Default tried another thing, subscript out of range

altered the code in my first message a bit. Still no luck. Now i get a subscript out of range error....hm

I dont know if my syntax with the dates (if then statements) are right.

please hel
-Jay Baxte

New Code
Sub ArchivedRoutine(

Dim iCt2 As Intege
Dim iRow3 As Intege
Dim iRow4 As Intege
Dim ws3 As Workshee
Dim ws4 As Workshee
Dim erow2 As Intege

Set ws3 = Sheets("Sheet2"
Set ws4 = Sheets("Sheet3"
iRow3 =
erow2 =
While ws4.Cells(erow2, 13) < "": erow2 = erow2 + 1: Wen
iRow4 = erow

'copy from sheet2 to sheet
Do Until ws3.Cells(iRow3, 13) = "
If DateValue(ws3.Cells(1, 2)) - DateValue(ws3.Cells(iRow3, 13)) 90 The
For iCt2 = 1 To 1
ws4.Cells(iRow4, iCt2) = ws3.Cells(iRow3, iCt2
Next iCt
iRow4 = iRow4 +
End I
iRow3 = iRow3 +
Loo

'delete from sheet
For iCt2 = iRow3 To 2 Step -
If DateValue(ws3.Cells(1, 2)) - DateValue(ws3.Cells(iRow3, 13)) 90 Then ws3.Rows(iCt2).Delet
Next iCt

End Sub