Freshpetguy
04-16-2014, 09:45 AM
Hello and I'll thank you in advance for any help.
I am trying to do multiple checks in a couple of different loops
Loopctr moves down the column to check for the SKU and the formula number I need
Once I have the formula then I want to check column headings to see if that raw material number is present in the headings.
It starts at column 3 and then checks to see if the cell is empty, if so, then it will drop the raw material number in that cell.
If the raw material number equals the value in that cell, then I want it to move to the next cell to the right and check that one.
Issues:
I keep getting a syntax error on the "Continue For" statement
Anything else ya'all can help with would be appreciated.
Thanks,
MatlInfo:
Let MatlRow = 58
Let MatlCol = 1
MatlList:
MatlRow = MatlRow + 1
For loopctr = 59 To 96
Cells(loopctr, MatlCol).Select
If IsDate(CDate(ActiveCell.Value)) = True Then
DayofWeek = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
SKU = ActiveCell.Value
Formula = Sheets("Schedule").Evaluate("Index($A$4:$P$54, Match(DayofWeek & SKU, $E$4:$E$54 & $A$4:$A$54, 0), 3)")
If Formula = "FR710 Fresh 2800" Then
MeatNo1 = Sheets("Schedule").Evaluate("Index('Bethlehem Master Complete Meals Recipe File.xlsx'!FR710Fresh2800,2,1)")
For i = 3 To 12
If IsEmpty(Cells(55, i)) Then Cells(55, i).Value = MeatNo1
If Cells(55, i).Value = MeatNo1 Then
Continue For
End If
Next
GoTo MatlList
Else
If ActiveCell.Value = 0 Then
GoTo MatlList
Else
SKU = ActiveCell.Value
MatlRow = MatlRow + 1
SKU = Cells(MatlRow, MatlCol).Value
End If
End If
Next loopctr
I am trying to do multiple checks in a couple of different loops
Loopctr moves down the column to check for the SKU and the formula number I need
Once I have the formula then I want to check column headings to see if that raw material number is present in the headings.
It starts at column 3 and then checks to see if the cell is empty, if so, then it will drop the raw material number in that cell.
If the raw material number equals the value in that cell, then I want it to move to the next cell to the right and check that one.
Issues:
I keep getting a syntax error on the "Continue For" statement
Anything else ya'all can help with would be appreciated.
Thanks,
MatlInfo:
Let MatlRow = 58
Let MatlCol = 1
MatlList:
MatlRow = MatlRow + 1
For loopctr = 59 To 96
Cells(loopctr, MatlCol).Select
If IsDate(CDate(ActiveCell.Value)) = True Then
DayofWeek = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
SKU = ActiveCell.Value
Formula = Sheets("Schedule").Evaluate("Index($A$4:$P$54, Match(DayofWeek & SKU, $E$4:$E$54 & $A$4:$A$54, 0), 3)")
If Formula = "FR710 Fresh 2800" Then
MeatNo1 = Sheets("Schedule").Evaluate("Index('Bethlehem Master Complete Meals Recipe File.xlsx'!FR710Fresh2800,2,1)")
For i = 3 To 12
If IsEmpty(Cells(55, i)) Then Cells(55, i).Value = MeatNo1
If Cells(55, i).Value = MeatNo1 Then
Continue For
End If
Next
GoTo MatlList
Else
If ActiveCell.Value = 0 Then
GoTo MatlList
Else
SKU = ActiveCell.Value
MatlRow = MatlRow + 1
SKU = Cells(MatlRow, MatlCol).Value
End If
End If
Next loopctr