Below is the code I posted earlier to filter and delete rows that meet certain criteria.
I would now only like to delete and shift cells up the filtered rows only from Column D to F. Can I get help with code for this task?
Code:
const xlUp = -4162
lastRow = ws1.UsedRange.Rows.Count
lastColumn = ws1.UsedRange.Columns.Count
Set rngDataBlock = ws1.Range(ws1.Cells(1,1),ws1.Cells(lastRow,lastColumn))
rngDataBlock.AutoFilter 4,"a",,,False
If ws1.Cells(1,4).Value = "a" Then
ws1.AutoFilter.Range.Delete xlUp
Else
ws1.AutoFilter.Range.Offset(1).Delete xlUp
End If
ws1.AutoFilterMode = False
I would now only like to delete and shift cells up the filtered rows only from Column D to F. Can I get help with code for this task?