U
universal
Hello All,
I have a macro which copy/pastes from a variety of workbooks into a ne
workbook. The nature of the data dictates that once it is collate
like this, the rows which have nothing in column A are redundant an
can be deleted.
This is what I have already (cobbled together from other peoples code)
it just doesnt seem to do what I'd thought:
Sub DeleteSpareRows()
Dim MyRange As Range
Dim MyCell As Range
Set MyRange = Worksheets("AllWorkbooksCollated").Range("a5:a2500")
For Each MyCell In MyRange
If MyCell = "" Then
MyCell.Rows.Delete Shift:=xlUp
End If
Next
End Sub
For information, the rest of the row tends to have either data o
formulas, but is just not relevant.
Many thanks in advance,
E
I have a macro which copy/pastes from a variety of workbooks into a ne
workbook. The nature of the data dictates that once it is collate
like this, the rows which have nothing in column A are redundant an
can be deleted.
This is what I have already (cobbled together from other peoples code)
it just doesnt seem to do what I'd thought:
Sub DeleteSpareRows()
Dim MyRange As Range
Dim MyCell As Range
Set MyRange = Worksheets("AllWorkbooksCollated").Range("a5:a2500")
For Each MyCell In MyRange
If MyCell = "" Then
MyCell.Rows.Delete Shift:=xlUp
End If
Next
End Sub
For information, the rest of the row tends to have either data o
formulas, but is just not relevant.
Many thanks in advance,
E