Excel VBA: 按照条件插入行
来源:互联网 发布:宝宝店软件 编辑:程序博客网 时间:2024/05/16 19:48
Sub Macro1()
Dim softwareVersion As String
Dim recentFlag As String
Dim historyFlag As String
Dim maxRowsNumber As Long
Dim targetColumn As Integer
Dim imageColumn As Integer
maxRowsNumber = 65535
recentFlag = "Y"
historyFlag = "N"
targetColumn = 8
imageColumn = 10
'Enter the newest version in this place
softwareVersion = "3.08.00"
For i = 7 To maxRowsNumber Step 1
If Cells(i, 6) = recentFlag Then
Rows(i).Copy
Rows(i + 1).Insert
Cells(i, 6) = historyFlag
Cells(i + 1, 6) = recentFlag
Cells(i + 1, 8) = softwareVersion
Cells(i + 1, 10) = softwareVersion
i = i + 1
ElseIf Cells(i, 6) = "" Then
i = maxRowsNumber
End If
Next i
End Sub
Sub Macro1()
Dim SoftwareVersion As String
SoftwareVersion = "3.08.00"
For i = 7 To 65535 Step 1
If Cells(i, 6) = "Y" Then
Rows(i).Copy
Rows(i + 1).Insert
Cells(i, 6) = "N"
Cells(i + 1, 6) = "Y"
Cells(i + 1, 8) = SoftwareVersion
Cells(i + 1, 10) = SoftwareVersion
i = i + 1
ElseIf Cells(i, 6) = "" Then
i = 65535
End If
Next i
End Sub
- Excel VBA: 按照条件插入行
- VBA插入行和插入列的作用域
- pb编程高亮行,插入行,条件查询等操作
- 利用VB在Excel中复制插入行
- C#使用NPOI向Excel版当中插入行
- delphi控制excel ,在指定单元格后插入行
- jxl 生成excel文件 采用模板 动态插入行
- Excel VBA 多条件查询
- insertAdjacentHTML动态插入行
- TABLE下插入行
- insertAdjacentHTML动态插入行
- insertAdjacentHTML动态插入行
- POI实现插入行
- insertAdjacentHTML动态插入行
- POI 插入行
- NPOI插入行
- Excel 单元格按照条件改变背景颜色
- excel中插入行后能自动插入上一行…
- Locations of visitors to this page 常用链接 我的随笔 我的评论 我的参与 最新评论 留言簿(16) 给我留言
- 百度语义理解开放平台使用方法
- Java分布式处理技术(RMI、JNDI)
- 华北黄淮等地“炙烤”天气持续 局地气温可达40℃
- 并查集
- Excel VBA: 按照条件插入行
- C++11中的tuple应用:让函数返回多个值
- Another app is currently holding the yum lock
- SLEIFSELI
- <实例>输出给定字符串的全部连续子序列
- 2014年5月最后一周工作总结
- iOS常用控件尺寸大集合
- Android 完美实现图片圆角和圆形(对实现进行分析)
- WIN7 查看端口被什么程序占用