编辑: 2/2/19
我仍然在努力理解这一点。我做了更多的阅读,并意识到我走错了路。我已经创建了一个更好的解释我正在尝试做什么,并在下面的示例。我需要你的帮助与步骤1-2,步骤4-5和步骤7-9。感谢您的耐心和理解!
Sub Weeder_Repeater()
'
' 1) Copy Columns "D:L" Starting at Line 4 from Candidate Weeder sheet
' 2) Special Paste, Values, Transpose, to Metal Powder Bed AM Calculator sheet Cell "Q6"
' 3) Call Weeder_RAPID_Cal macro
' 4) Copy solution from Metal Powder Bed AM Calculator sheet Cell "Q15"
' 5) Special Paste, Values to Candidate Weeder sheet Column "O"
' 6) Call Weeder_RAPID_Reset macro
' 7) Move to next line in Candidate Weeder sheet
' 8) Repeat Steps 1-7
' 9) End when Blank in Column "D" encountered
'
'Step 1-2
'Step 3
Call Weeder_RAPID_Calc
'Step 4-5
'Step 6
Call Weeder_RAPID_Reset
'Step 7-9
End Sub发布于 2019-01-31 17:08:11
‘指定超出范围的数据
计数器=3到10000
'Conditions that you can change it. in the bellow codes (counter) is your cell number and the number after comma is your column index. you can also do not specify your column and only loop through cells. you can also use from (i,j) for looping through both cells and columns (means two (For) loops).如果工作表(“第二质量控制”).Cells(计数器,2).Value <工作表(“第二质量控制”).Cells(计数器,3) _或工作表(“第二质量控制”).Cells(计数器,3).Value <工作表(“第二质量控制”).Cells(计数器,4) _或工作表(“第二质量控制”).Cells(计数器,4).Value <工作表(“第二质量控制”).Cells(计数器,5)则
工作表(“第二QC”).Rows(计数器).Interior.Color= 65535
否则工作表(“第二个QC”).Cells(计数器).Value=工作表(“第二个QC”).Cells(计数器).Value
结束If
下一个计数器
‘'Exit示例:
子ExitStatementDemo()
Dim I,MyNum
Do ' Set up infinite loop.
For I = 1 To 1000 ' Loop 1000 times.
MyNum = Int(Rnd * 1000) ' Generate random numbers.
Select Case MyNum ' Evaluate random number.
Case 7: Exit For ' If 7, exit For...Next.
Case 29: Exit Do ' If 29, exit Do...Loop.
Case 54: Exit Sub ' If 54, exit Sub procedure.
End Select
Next I
Loop结束子对象
我希望它能帮上忙
https://stackoverflow.com/questions/54448721
复制相似问题