|
楼主 |
发表于 2012-9-6 12:04
|
显示全部楼层
爱疯 发表于 2012-9-6 09:05
学习5201314的方法
Sub 批量打印()
Dim i%, j%
If [D6] > [D7] Then MsgBox "起始必须小于结束!": [D6] = "": [D7] = "": Exit Sub
With Sheets("资料")
For i = [D6] To [D7]
If .Cells(i + 1, 6) + .Cells(i + 1, 7) > 180 Then
[C3] = .Cells(i + 1, 1)
[E3] = .Cells(i + 1, 2)
[G3] = .Cells(i + 1, 3)
[I3] = .Cells(i + 1, 4)
[C4] = .Cells(i + 1, 5)
[E4] = .Cells(i + 1, 6)
[G4] = .Cells(i + 1, 7)
[I4] = .Cells(i + 1, 8)
Sheets("成绩单").Range("b3:i4").PrintOut
End If
Next
End With
End Sub
你看这个代码是不是和你的效果一样
|
|