打印excel提示运行时错误9下标越界 调试之后出现宏那个黄色代码怎么弄啊 ,
Sheets("sheet2").Cells(7,3).Value=Sheet1.Cells(i,1).ValueSheets("sheet2").Cells(6,9)....
Sheets("sheet2").Cells(7, 3).Value = Sheet1.Cells(i, 1).Value
Sheets("sheet2").Cells(6, 9).Value = Sheet1.Cells(i, 3).Value
Sheets("sheet2").Cells(17, 3).Value = Sheet1.Cells(i, 5).Value
Sheets("sheet2").Cells(18, 3).Value = Sheet1.Cells(i, 6).Value
Sheets("sheet2").Cells(14, 3).Value = Sheet1.Cells(i, 7).Value
Sheets("sheet2").Cells(14, 5).Value = Sheet1.Cells(i, 8).Value
Sheets("sheet2").Cells(16, 3).Value = Sheet1.Cells(i, 9).Value
Sheets("sheet2").Cells(15, 3).Value = Sheet1.Cells(i, 10).Value
' Sheets("sheet2").Cells(13, 7).Value = Sheet1.Cells(i, 16).Value
' Sheets("sheet2").Cells(13, 3).Value = Sheet1.Cells(i, 13).Value
' Sheets("sheet2").Cells(13, 5).Value = Sheet1.Cells(i, 14).Value
Sheets("sheet2").Cells(10, 7).Value = Sheet1.Cells(i, 16).Value
Sheets("sheet2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
For i = Sheet1.Cells(1, 6) To Sheet1.Cells(1, 6) 展开
Sheets("sheet2").Cells(6, 9).Value = Sheet1.Cells(i, 3).Value
Sheets("sheet2").Cells(17, 3).Value = Sheet1.Cells(i, 5).Value
Sheets("sheet2").Cells(18, 3).Value = Sheet1.Cells(i, 6).Value
Sheets("sheet2").Cells(14, 3).Value = Sheet1.Cells(i, 7).Value
Sheets("sheet2").Cells(14, 5).Value = Sheet1.Cells(i, 8).Value
Sheets("sheet2").Cells(16, 3).Value = Sheet1.Cells(i, 9).Value
Sheets("sheet2").Cells(15, 3).Value = Sheet1.Cells(i, 10).Value
' Sheets("sheet2").Cells(13, 7).Value = Sheet1.Cells(i, 16).Value
' Sheets("sheet2").Cells(13, 3).Value = Sheet1.Cells(i, 13).Value
' Sheets("sheet2").Cells(13, 5).Value = Sheet1.Cells(i, 14).Value
Sheets("sheet2").Cells(10, 7).Value = Sheet1.Cells(i, 16).Value
Sheets("sheet2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
For i = Sheet1.Cells(1, 6) To Sheet1.Cells(1, 6) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询