During data statistics and analysis, due to various reasons such as recorded add, delete, and data sheets, some excess spaces are often occurred in the table. The presence of these spaces affects the appearance and affects the results of data analysis. If you handle it, you will be handled by a line. With powerful Office VBA, you can easily delete.
First, create a macro, macher is Delnullrow, the code is as follows:
SUB DELNULLROW
DIM B, C AS INTEGER
Dim A as Range
For b = 1 to Range ("b65536"). End (xlup) .row
K = 0: set a = cells (b, 1)
'Test if the value of the four columns of the row is empty (the user can specify the number as required)
For c = 1 TO4
IF Cells (B, C) = "" "" THEN K = K 1
Next C
'If the row is empty in four cells, then deletes the line.
IF K = 4 THEN
a.ntreamow.delete shift: = xlup
END IF
Next B
End Sub
Second, Description: Customize a toolbar and right click to specify the created macro to the button. At the same time, you can change the button name and image, and you can specify the size of the number of null null cells, and then delete the base, even the width Cells (XLRight). Columns can be specified as the entire column. In addition to the toolbar buttons can be deleted or can be assigned to a custom right-click menu, this is still a custom. (Reproduced)