该脚本主要用于将测量材料的数据库分成两组。材料具有完美的测量切口,没有剩余部分,材料没有剩余部分。稍后我将添加腰围百分比并相应地对结果进行排名。有谁知道为什么代码不能按指定的方式工作。我一直在研究这个问题大约2个小时,但无法得到准确的结果。
For i = 2 To finalrow
If Cells(i, 8) = grade And Cells(i, 4) = caliper Then 'If the grade requested matches column results then copy
If ((Cells(i, 9) * 10) Mod (10 * length)) / 10 = 0 And ((Cells(i, 10) * 10) Mod (10 * width)) / 10 = 0 Then 'Requires all multiples to be perfect
Range(Cells(i, 2), Cells(i, 64)).Copy 'Copy columns 2 to 64 (B to BM)
search.Select 'Go to report sheet
Range("A500").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats 'Paste by an offset of one row
RAW.Select 'Go back to data sheet and keep searching
Else: Decimal_Length = (Cells(i, 9) / length - Int(Cells(i, 9) / length)) > 0 And Decimal_Width = (Cells(i, 10) / width - Int(Cells(i, 10) / width)) > 0 And length > Cells(i, 9) And width > Cells(i, 10) 'Requires all dimensions to be greater than the requested dimension
'Requires all remainder value to be positive
Range(Cells(i, 2), Cells(i, 64)).Copy 'Copy columns 2 to 64 (B to BM)
search.Select 'Go to report sheet
Range("A500").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats 'Paste by an offset of one row
RAW.Select 'Go back to data sheet and keep searching
End If
End If