ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting empty rows and field names in report (https://www.excelbanter.com/excel-programming/315588-deleting-empty-rows-field-names-report.html)

Pele[_2_]

Deleting empty rows and field names in report
 
I have a report which has embedded into it, blank rows and
the names of fields at the beginning of each page. I tried
to do a macro to seach in column A in excel for blank
cells and cells with the name of the first field called
plnt; the macro should then delete those fields.

Unfortunately, I am just learning visual basic and can't
do it. Below is what I had done. Please help. Thanks.

Pele





Sub MacDeleterows()
'
' MacDeleterows Macro
'

Range("a2").Select
Do Until ActiveCell.SpecialCells(xlCellTypeLastCell)

If ActiveCell = "" Or ActiveCell = "plnt" Then
Selection.EntireRow.Delete
ActiveCell.Offset(1, 0).Select
'Range("A1").Select
'ActiveCell.SpecialCells(xlLastCell).Select
End If
Loop
End Sub


All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com