|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
传不了附件。。。
Sub 打印()
m = --InputBox("开始行?", "")
n = --InputBox("结束行?", "")
If m < 1 Or n < m Then Exit Sub
For k = m To n
Sheet2.Range("C3:D3,G3:J3,M3:N3,C4:D4,G4:J4,M4:N4,C7:C18,K7:K18,N7:N18").ClearContents
Sheet2.[c3] = Sheet1.Cells(k, 2)
Sheet2.[g3] = Sheet1.Cells(k, 5)
Sheet2.[m3] = Sheet1.Cells(k, 1)
Sheet2.[c4] = Sheet1.Cells(k, 3)
Sheet2.[g4] = Sheet1.Cells(k, 4)
Sheet2.[m4] = Sheet1.Cells(k, 6)
For i = 8 To 14
Sheet2.Cells(i, 3) = Sheet1.Cells(k, 4 * (i - 6) - 1)
Sheet2.Cells(i, 11) = Sheet1.Cells(k, 4 * (i - 6) + 1)
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Next
Sheet2.Range("C3:D3,G3:J3,M3:N3,C4:D4,G4:J4,M4:N4,C7:C18,K7:K18,N7:N18").ClearContents
End Sub
|
|