It shows TestRange as "AF8" and TestRange2 as "AE8" never as 30 or 0. I never get a value for those two. Here is my full code, maybe there is something else.
Sub Over_60_Days()
'==============================================================
' POPULATE THE OVER 60 DAYS OLD TAB
'
' Description: This macro moves and deletes all part numbers that
' has been shipped more than 60 days and has future of 0
' future parts.
'
'Macro created on 3/1/2006
'Written by Wendy Smith
'=================================================================
Dim cellstart As Integer 'starting point on source sheet (row)
Dim reportlocation As String
Dim destsh As String 'destination sheet
Dim Output(1 To 66) As String
Dim sh As String 'source sheet
Dim i As String
Dim lastrow As String 'last row in sheet to look at
Dim z As Integer
Dim x As Integer
Dim TestRange As String 'Test string for over 30 days old
Dim TestRange2 As String 'Test string for future 6 wks
Dim TestRange3 As String
Dim TestRange4 As String
Dim parts As String
Dim m As String
Dim n As String
Dim v As Integer
Dim y As Integer
cellstart = 3 'starting point on source sheet
parts = 0
sh = "Daily" 'Sheet where the parts information is stored DO NOT CHANGE NAME OF SHEET!!
destsh = "Over_60_Days" 'Name of sheet where over 30 days since last shipped DO NOT CHANGE NAME OF SHEET!!
'Turn off Screen Updating
Application.ScreenUpdating = False
'Build Over 60 Sheet
Range("A2:AF903").sort Key1:=Range("AF2"), Order1:=xlDescending, header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal 'sort column AF
'Get Data From Rows
i = cellstart
TestRange = "AF" + i 'over 60 days column
TestRange2 = "AE" + i 'future 6 wks production column
TestRange3 = "A" + i 'part number column
For x = 1 To 1000
---> If UCase(Trim(Sheets(sh).Range(TestRange) > 60) And UCase(Trim(Sheets(sh).Range(TestRange2) = 0))) Then
'prep machine
Output(1) = "B" + i
Output(2) = Sheets(sh).Range(Output(1)).Value
'prep weight
Output(3) = "C" + i
Output(4) = Sheets(sh).Range(Output(3)).Value
'prep PointType
Output(5) = "D" + i
Output(6) = Sheets(sh).Range(Output(5)).Value
'Output info to Over 60 sheet
TestRange3 = "A" + i
parts = parts + 1
m = parts + 2 'tells where to start importing information on dest sheet (row)
reportlocation = "A" + m 'starting column for destination sheet
Sheets(sh).Range(TestRange3).Copy Sheets(destsh).Range(reportlocation)
reportlocation = "B" + m ' machine
Sheets(destsh).Range(reportlocation) = Output(2)
reportlocation = "C" + m 'weight
Sheets(destsh).Range(reportlocation) = Output(4)
reportlocation = "D" + m 'point type
Sheets(destsh).Range(reportlocation) = Output(6)
'Sheets(sh).Range(TestRange3).Delete
TestRange = "AF" + i
TestRange2 = "AE" + i
i = i + 1
Else
TestRange = "AF" + i
TestRange2 = "AE" + i
i = i + 1
End If
Next
'Turn on screen updating
Application.ScreenUpdating = True
End Sub