VB中copy单元格并且粘贴的问题(高手进)
DimxlappDimxlbookDimxlsheetDimxlapp2Dimxlbook2Dimxlsheet2'表格设置Setxlapp=CreateObject("...
Dim xlapp
Dim xlbook
Dim xlsheet
Dim xlapp2
Dim xlbook2
Dim xlsheet2
'表格设置
Set xlapp = CreateObject("excel.application")
xlapp.Displayalerts = False
Set xlbook = xlapp.Workbooks.Open(Text1.Text)
xlapp.Visible = True
Set xlsheet = xlbook.Worksheets(1)
'接收定义值
xlsheet.Rows("1:35").Select
xlsheet.Range("R1").Activate
xlsheet.Selection.Copy
xlsheet.Rows("36:36").Select
xlsheet.Paste
xlsheet.Rows("36:36").Select
xlsheet.HPageBreaks.Add Before:=ActiveCell
xlbook.Close
我想把1到35行的东西复制到36到70行并且在70行插入一个分页符,并且设置为打印区域。高手帮忙看看哪里出错了啊!
运行到 xlsheet.Selection.Copy的时候出现错误 展开
Dim xlbook
Dim xlsheet
Dim xlapp2
Dim xlbook2
Dim xlsheet2
'表格设置
Set xlapp = CreateObject("excel.application")
xlapp.Displayalerts = False
Set xlbook = xlapp.Workbooks.Open(Text1.Text)
xlapp.Visible = True
Set xlsheet = xlbook.Worksheets(1)
'接收定义值
xlsheet.Rows("1:35").Select
xlsheet.Range("R1").Activate
xlsheet.Selection.Copy
xlsheet.Rows("36:36").Select
xlsheet.Paste
xlsheet.Rows("36:36").Select
xlsheet.HPageBreaks.Add Before:=ActiveCell
xlbook.Close
我想把1到35行的东西复制到36到70行并且在70行插入一个分页符,并且设置为打印区域。高手帮忙看看哪里出错了啊!
运行到 xlsheet.Selection.Copy的时候出现错误 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询