wps中用vba将一个工作表中的数据一键保存到别一个工作表中,代码出现下标越界错误,求教
这是网上找来的代码,自己有一定的vc基础能看懂,但没接触过vba,稍改了下运行时出现这个错误,请大神指导Subjizhang()DimWS1AsWorksheet,WS2...
这是网上找来的代码,自己有一定的vc基础能看懂,但没接触过vba,稍改了下运行时出现这个错误,请大神指导
Sub jizhang()
Dim WS1 As Worksheet, WS2 As Worksheet
Dim Rnum1, Rnum2
Set WS1 = Worksheets("尚品美居销售单")
Set WS2 = Worksheets("记账")
Rnum2 = WS2.Range("b65536").End(xlUp).Row + 1
Rnum1 = 6
Do Until WS1.Cells(Rnum1, 1) = "" Or WS1.Cells(Rnum1, 1) = "本单小计"
WS2.Cells(Rnum2, 2) = WS1.[b2]
WS2.Cells(Rnum2, 3) = WS1.[b3]
WS1.Cells(Rnum1, 1).Resize(1, 5).Copy WS2.Cells(Rnum2, 5)
Rnum1 = Rnum1 + 1
Rnum2 = Rnum2 + 1
Loop
End Sub 展开
Sub jizhang()
Dim WS1 As Worksheet, WS2 As Worksheet
Dim Rnum1, Rnum2
Set WS1 = Worksheets("尚品美居销售单")
Set WS2 = Worksheets("记账")
Rnum2 = WS2.Range("b65536").End(xlUp).Row + 1
Rnum1 = 6
Do Until WS1.Cells(Rnum1, 1) = "" Or WS1.Cells(Rnum1, 1) = "本单小计"
WS2.Cells(Rnum2, 2) = WS1.[b2]
WS2.Cells(Rnum2, 3) = WS1.[b3]
WS1.Cells(Rnum1, 1).Resize(1, 5).Copy WS2.Cells(Rnum2, 5)
Rnum1 = Rnum1 + 1
Rnum2 = Rnum2 + 1
Loop
End Sub 展开
2个回答
展开全部
你上一个问题,都给你回答了
你都不试下
你都不试下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询