1
我是VBA的新手。 我已经将这段代码写在名为“Outputs”的表单中的按钮单击事件中。 问题是,当我尝试复制数据形式TestInput片到计算器片我得到一个运行时错误1004
我的代码如下所示从Excel中的不同工作表中复制数据
Do While currentInd < lastRows
With Worksheets("TestInput")
Worksheets("Calculator").Range(Cells(3, "C"), Cells(3, (lastColumns))).Value = .Range(.Cells(currentInd, "A"), .Cells(currentInd, lastColumns)).Value
End With
如果我更换的第3行我代码(“计算器”)。Range(“C3:FC3”)。Value = .Range(.Cells(currentInd,“A”),.Cells(currentInd,lastColumns))。Value
then罚款,但“lastColumns”是一个变量,将改变,所以我不想修复我的范围“C3:FC3”
感谢你这么多:) – 2012-03-12 12:13:12