View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claud Balls Claud Balls is offline
external usenet poster
 
Posts: 72
Default Determining What Jobs Ready To Move to Production

I've done something similar. I've made changes to my code to reflect
what you are trying to do, but you will probably have to tweak it to fit
your needs. Also, sheet names will be different.

Sub Make_sched()

Dim intCounter As Integer, intMoveTo As Integer
Dim intNumRows As Integer, intPart As Integer
Dim strMoveCond As String
intCounter = 2
intMoveTo = 2

Sheets("Today").Range("A1:I500").Clear
Sheets("Master").Range("A1:A7").Copy _
Destination:=Sheets("Today").Range("A1")
intNumRows = Worksheets("Master").Cells(500, 1).End(xlUp).Row + 1

While intCounter < intNumRows

If Sheets("Master").Cells(intCounter, "D").Value
Sheets("Master").Cells(intCounter, "C").Value Then
strMoveCond = "NO"
Else
strMoveCond = "YES"
End If 'Allows blank lines to be copied

If strMoveCond = "YES" Then
Sheets("Master").Select
Range(Cells(intCounter, "A"), Cells(intCounter, "E")).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Today").Select
Range(Cells(intMoveTo, "A"), Cells(intMoveTo, "E")).Select
ActiveSheet.Paste

intMoveTo = intMoveTo + 1
End If

intCounter = intCounter + 1

Wend

Columns("A:E").AutoFit

Application.Goto Reference:=Worksheets("Today").Cells(1, 1)

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!