【发布时间】:2020-03-06 20:30:57
【问题描述】:
仅当另一个单元格等于“是”时,我才尝试复制列的内容。如果单元格等于“是”,我想将选定的列范围粘贴到另一个工作簿中。然后循环到下一个“是”。
If M2 = "Yes" then copy AD2:AD200 if "NO" go to the next "if"
If M3 = "Yes" then copy AE2:AE200 if "NO" go to the next "if"
If M4 = "Yes" then copy AF2:AF200 if "NO" go to the next "if"
等等……
我要寻找的最后一个是 M11。
然后将复制范围粘贴到工作表“QA 状态中的案例”中的最后一个空白单元格,
range("AL200",range("al200").end(xlUp).select
这是我目前所拥有的:
Sheets("Sheet1").Select
If Range("M8").Value = True Then
Range("aj2:aj200").Select
Selection.Copy
Sheets("Cases in QA Status").Select
End If
End Sub
【问题讨论】:
标签: vba loops if-statement