Quantcast
Channel: Tech Support Guy
Viewing all articles
Browse latest Browse all 29110

Excel Detete Empty Rows

$
0
0
The following code deletes all empty rows after any row that has words in a cell....but when I run the macro, it still askes from Excel how many rows do go down....so it starts at A1 but I have to add when asked how many rows to move down over....

Is there something to add, where I can automatically put in the macro how many rows to move down on, as this is a macro that runs automatically as part of excel form I use...thanks so much and happy to hear back very soon:

Code:

Sub DeleteEmptyRows()
'
'This macro will delete all rows, which are missing data in a
'particular column, underneath and including the selected cell.
'
Dim Counter
Dim i As Integer
Counter = InputBox("Enter the total number of rows to process")
'ActiveCell.Select
 Range("A1").Select
For i = 1 To Counter
If ActiveCell = "" Then
Selection.EntireRow.Delete
Counter = Counter - 1
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
End Sub


Viewing all articles
Browse latest Browse all 29110

Trending Articles