|
楼主 |
发表于 2018-2-11 10:58
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
已按自己的思路做出VBA,请大家帮忙看看能不能精简
Sub test()
For i = 1 To 10
If Cells(2, i) = Cells(8, 10) Then
If Cells(3, i) = Cells(9, 10) Then
If Cells(4, i) = Cells(10, 10) Then
Range(Cells(2, i), Cells(27, i)).Select
Selection.Copy
End If
End If
End If
Next
Workbooks.Open "D:/液体月报数据.xlsx"
For j = 1 To 10000
If Cells(1, j) = Cells(29, 3) Then
If Cells(2, j) = Cells(30, 3) Then
If Cells(3, j) = Cells(31, 3) Then
Range(Cells(1, j), Cells(26, j)).Select
End If
End If
End If
Next
Selection.PasteSpecial
ActiveWorkbook.Close True
End Sub
|
|