excel - 使用 VB 模块在 MS Excel 中重复行
问题描述
我在 MS Excel 中使用这个 VBA 片段,它允许我通过在弹出对话框中输入的“X”数字复制行。我想改变它,使它只重复第 3、5、7 行等,但不重复第 1 行。
Sub insertrows()
Dim I As Long
Dim xCount As Integer
LableNumber:
xCount = Application.InputBox("Number of Rows", "Popup menu", , , , , , 1)
If xCount < 1 Then
MsgBox "The entered number of rows is error ,please enter again"
GoTo LableNumber
End If
For I = Range("A" & Rows.CountLarge).End(xlUp).Row To 2 Step -1
Rows(I).Copy
Rows(I).Resize(xCount).Insert
Next
Application.CutCopyMode = False
End Sub
解决方案
推荐阅读
- mysql - group and order in mysql
- mysql - 使用 dblink 从 oracle 插入 MySQL 表
- java - 如何在 Tomcat 8 中设置 Java 运行时参数
- c# - c# HttpWebRequest 获取响应字符串
- angular - 调用验证器并从 focusout 上的自定义指令返回有效/无效为真/假:Angular 5
- python - 我想从用户那里导入值,用于这个 t 测试
- google-translate - Google Cloud Translation API:语言检测算法
- docker - 保险丝 7:执行命令时出错:零:创建 docker 映像时
- reactjs - 未定义不是函数 SwitchNavigator 错误
- c++ - 如何让 jsoncpp 编码 unicode 字符串?