|
本帖最后由 renzhife 于 2021-6-19 11:01 编辑
Sub 资料打印()
Dim arow As Integer, i As Integer, brow As Integer, crow As Integer, drow As Integer, erow As Integer, mrow As Integer, fil1 As String, fil2 As String, rng As Range, nrow As Integer
Application.ScreenUpdating = False
Sheets("梁场台账").Select
arow = Range("A1").CurrentRegion.Rows.Count
Set rng = Range(Cells(4, 1), Cells(arow, 17))
If Not rng.Find("") Is Nothing Then
MsgBox "警告:参数单元格有空值,请参数全部输入后使用!" & vbCrLf & " " & vbCrLf & " 开发者:贾彬" & vbCrLf & " 版本号Trial1.0", Title:="预制梁场资料助手"
Set rng = Nothing
Else
Sheets("计算").Visible = True
Sheets("1").Visible = True
Sheets("2-1").Visible = True
Sheets("2-2").Visible = True
Sheets("2-3").Visible = True
Sheets("2-4").Visible = True
Sheets("2-5").Visible = True
Sheets("2-6").Visible = True
Sheets("2-7").Visible = True
Sheets("2-8").Visible = True
Sheets("2-9").Visible = True
Sheets("2-10").Visible = True
Sheets("2-11").Visible = True
Sheets("2-12").Visible = True
Sheets("3").Visible = True
Sheets("4").Visible = True
Sheets("5").Visible = True
Sheets("6").Visible = True
Sheets("7").Visible = True
Sheets("8").Visible = True
Sheets("9").Visible = True
Sheets("10").Visible = True
Sheets("11").Visible = True
Sheets("12").Visible = True
Sheets("13").Visible = True
Sheets("14").Visible = True
Sheets("15-1").Visible = True
Sheets("15-2").Visible = True
Sheets("15-3").Visible = True
Sheets("15-4").Visible = True
Sheets("15-5").Visible = True
Sheets("15-6").Visible = True
Sheets("15-7").Visible = True
Sheets("16").Visible = True
Sheets("17").Visible = True
Sheets("18").Visible = True
Sheets("19").Visible = True
Sheets("梁场台账").Select
For i = 4 To arow
Range(Cells(i, 1), Cells(i, 20)).Select
Selection.Copy
Sheets("计算").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-5").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-6").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-7").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-8").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-9").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-10").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-11").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("2-12").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("5").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("6").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("7").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("8").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("9").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("10").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("11").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("12").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("13").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("14").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-5").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-6").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("15-7").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("16").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("17").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("18").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("19").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("梁场台账").Select
Next
Sheets("计算").Visible = False
Sheets("1").Visible = False
Sheets("2-1").Visible = False
Sheets("2-2").Visible = False
Sheets("2-3").Visible = False
Sheets("2-4").Visible = False
Sheets("2-5").Visible = False
Sheets("2-6").Visible = False
Sheets("2-7").Visible = False
Sheets("2-8").Visible = False
Sheets("2-9").Visible = False
Sheets("2-10").Visible = False
Sheets("2-11").Visible = False
Sheets("2-12").Visible = False
Sheets("3").Visible = False
Sheets("4").Visible = False
Sheets("5").Visible = False
Sheets("6").Visible = False
Sheets("7").Visible = False
Sheets("8").Visible = False
Sheets("9").Visible = False
Sheets("10").Visible = False
Sheets("11").Visible = False
Sheets("12").Visible = False
Sheets("13").Visible = False
Sheets("14").Visible = False
Sheets("15-1").Visible = False
Sheets("15-2").Visible = False
Sheets("15-3").Visible = False
Sheets("15-4").Visible = False
Sheets("15-5").Visible = False
Sheets("15-6").Visible = False
Sheets("15-7").Visible = False
Sheets("16").Visible = False
Sheets("17").Visible = False
Sheets("18").Visible = False
Sheets("19").Visible = False
End If
Application.ScreenUpdating = True
MsgBox " 电子版资料已发送至默认打印机打印中,请耐心等待。" & vbCrLf & " " & vbCrLf & " 开发者:贾彬" & vbCrLf & " 版本号Trial1.0", Title:="预制梁场资料助手"
End Sub
|
|