Hello all,
I am new to creating Excel macros and needed some help.
Have daily spreadsheets with thousands of lines on each sheet, Each line will contain words like "Cat", "Dog", or "Bird" with dates or value in following 3 columns. Need to remove lines that contain nothing in columns C:E but keeping the "Cat" and "Dog rows even if there is no data in column C:E. See sample below.
The end results, I need to see will be like below.
I did some search and was only able to find this but it can only keep the Cat row.
Dim LR As Long
LR = Cells(Rows.Count, "B").End(xlUp).Row
Range("A1:E" & LR).Select
Selection.AutoFilter
ActiveSheet.Range("A1:E" & LR).AutoFilter Field:=11, Criteria1:=""
ActiveSheet.Range("A1:E" & LR).AutoFilter Field:=6, Criteria1:="Cat"
ActiveSheet.Range("$A$1:$E$" & LR).Offset(1, 0).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.ShowAllData
Can someone please help? Thank you in advance!
I am new to creating Excel macros and needed some help.
Have daily spreadsheets with thousands of lines on each sheet, Each line will contain words like "Cat", "Dog", or "Bird" with dates or value in following 3 columns. Need to remove lines that contain nothing in columns C:E but keeping the "Cat" and "Dog rows even if there is no data in column C:E. See sample below.
Category | Cash received date | Credit received date | Account balance | |
1 | Cat | |||
2 | Dog | Feb 1 | $100 | |
3 | Bird | Feb 2 | $200 | |
4 | Cat | $300 | ||
5 | Dog | |||
6 | Bird |
The end results, I need to see will be like below.
Category | Cash received date | Credit received date | Account balance | |
1 | Cat | |||
2 | Dog | Feb 1 | $100 | |
3 | Bird | Feb 2 | $200 | |
4 | Cat | $300 | ||
5 | Dog |
I did some search and was only able to find this but it can only keep the Cat row.
Dim LR As Long
LR = Cells(Rows.Count, "B").End(xlUp).Row
Range("A1:E" & LR).Select
Selection.AutoFilter
ActiveSheet.Range("A1:E" & LR).AutoFilter Field:=11, Criteria1:=""
ActiveSheet.Range("A1:E" & LR).AutoFilter Field:=6, Criteria1:="Cat"
ActiveSheet.Range("$A$1:$E$" & LR).Offset(1, 0).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.ShowAllData
Can someone please help? Thank you in advance!