t******0 发帖数: 171 | | t*****g 发帖数: 2941 | 2 不会macro
我用的是conditional formatting,format有空格的cell,然后sort by cell color,再
手动删掉 | t******0 发帖数: 171 | 3 那多麻烦,而且sort by cell color会改变原来的顺序。
直接在原来的表中用filter blanks,然后copy, paste到另外一个表里就可以了。
我就是想回忆一下怎样用macro解决。
【在 t*****g 的大作中提到】 : 不会macro : 我用的是conditional formatting,format有空格的cell,然后sort by cell color,再 : 手动删掉
| t**********e 发帖数: 43 | 4 This might work, try it yourself, I have not done this for a while
Sub del_rows_if_empt_col1()
MsgBox (CStr(ActiveSheet.UsedRange.Rows.Count))
With ActiveSheet
For i = .UsedRange.Rows.Count To 1 Step -1
If (.Cells(i, 1).Value = "") Then
.Cells(i, 1).EntireRow.Delete
End If
Next i
End With
End Sub
There is a keyword for deciding if a cell is empty, can not remember what it
is.
【在 t******0 的大作中提到】 : 谢谢
| p****n 发帖数: 96 | | p******g 发帖数: 125 | 6 Shortcut:
Ctrl-A then Ctrl-A (select the whole sheet)
Alt-A then T (activate filter)
Ctrl-Home (select the top left corner)
Alt-DownArrow (pop up filter)
Toggle ALL and SPACEBAR
Toggle BLANK and SPACEBAR
ENTER
Ctrl-Home (back to top left)
DownArrow (move down one cell)
Ctrl-Shift-DownArrow (select all cells in first column except first one)
Shift-Space (select all rows except first one)
Ctrl- (minor sign, remove all rows selected)
Alt-A then T (disable filter)
Should be done within 10sec |
|