求重复指定次数运行宏的VBA代码:
希望有对话匡跳出来,可以输入重复次数,如输入"2",A1:A10COPY到B1后,A11:A20COPY到B11Submacro1()Range("A1:A10").Se...
希望有对话匡跳出来,可以输入重复次数,如输入"2",A1:A10 COPY 到B1后,A11:A20 COPY 到B11
Sub macro1()
Range("A1:A10").Select
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
End Sub 展开
Sub macro1()
Range("A1:A10").Select
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
End Sub 展开
展开全部
Sub 重复()
Dim c%, i%
Range([B1], [B1].End(xlDown)).Clear
Application.ScreenUpdating = 0
c = Application.InputBox(PROMPT:="", Type:=1)
For i = 1 To c * 10
Range("B" & i) = Range("A" & i)
Next
Application.ScreenUpdating = 1
End Sub
Dim c%, i%
Range([B1], [B1].End(xlDown)).Clear
Application.ScreenUpdating = 0
c = Application.InputBox(PROMPT:="", Type:=1)
For i = 1 To c * 10
Range("B" & i) = Range("A" & i)
Next
Application.ScreenUpdating = 1
End Sub
追问
为什么对话匡中熟入多少次,也不重复呢?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询