|
- Private Sub CommandButton8_Click()
- T = Timer
- Dim i As Integer
- i = ActiveCell.Row
- Cells(i, 1) = ""
- Cells(i, 2) = ""
- Cells(i, 3) = ""
- Cells(i, 4) = ""
- Cells(i, 5) = ""
- Cells(i, 6) = ""
- Cells(i, 7) = ""
- Cells(i, 8) = ""
- Cells(i, 9) = ""
- Cells(i, 10) = ""
- Cells(i, 11) = ""
- Cells(i, 12) = ""
- Cells(i, 13) = ""
- Cells(i, 14) = ""
- Cells(i, 15) = ""
- Do While Cells(i + 1, 1) <> ""
- Cells(i, 1) = Cells(i + 1, 1)
- Cells(i, 2) = Cells(i + 1, 2)
- Cells(i, 3) = Cells(i + 1, 3)
- Cells(i, 4) = Cells(i + 1, 4)
- Cells(i, 5) = Cells(i + 1, 5)
- Cells(i, 6) = Cells(i + 1, 6)
- Cells(i, 7) = Cells(i + 1, 7)
- Cells(i, 8) = Cells(i + 1, 8)
- Cells(i, 9) = Cells(i + 1, 9)
- Cells(i, 10) = Cells(i + 1, 10)
- Cells(i, 11) = Cells(i + 1, 11)
- Cells(i, 12) = Cells(i + 1, 12)
- Cells(i, 13) = Cells(i + 1, 13)
- Cells(i, 14) = Cells(i + 1, 14)
- Cells(i, 15) = Cells(i + 1, 15)
- i = i + 1
- Loop
- Cells(i, 1) = ""
- Cells(i, 2) = ""
- Cells(i, 3) = ""
- Cells(i, 4) = ""
- Cells(i, 5) = ""
- Cells(i, 6) = ""
- Cells(i, 7) = ""
- Cells(i, 8) = ""
- Cells(i, 9) = ""
- Cells(i, 10) = ""
- Cells(i, 11) = ""
- Cells(i, 12) = ""
- Cells(i, 13) = ""
- Cells(i, 14) = ""
- Cells(i, 15) = ""
- MsgBox "共计用时" & " " & (Timer - T) & "秒", , "温馨提示"
- End Sub
复制代码 以上代码虽然可以实现但运算速度不行。论坛老师让我使用数组但小弟刚接触数组这块薄弱请求支援
想要实现的效果是选中一行或选中某行某一单元格清除该行的内容,因为我做了保护所以不能使用删除!求大神改写代码或提供新的思路~~
Book1.rar
(7.21 KB, 下载次数: 14)
|
|