Delete Row From Table

hip2b2

Board Regular
Joined
May 5, 2003
Messages
135
Office Version
  1. 2019
Platform
  1. Windows
I need to modify a report (a table), based on the following:

1 - Rows 1 - 6 are report headers
2 - Data to be modified starts at row 7
3 - Data rows can be grouped, then a blank row, then another group, etc.
4 - The workbook is made up of several sheets, the report sheet is name (unsurprisingly) Report
5 - Rows to be deleted have the word "Closed" in Col L


As always thanks in advance for even looking at the problem.

Regards

hip
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Can you give examples of what you have and the resulting report?
 
Upvote 0
Can you give examples of what you have and the resulting report?

This is it, the number of rows may change from report to report, but the structure will be the same with only the rows where Col K value = Closed are to be deleted.

Thanks


Book1
ABCDEFGHIJK
1Header
2Header 2
3Header3
4
5FamilyClassDate 1Date 2Date 3Comments
6
7Name 18,10,12Dec 14, 2018Dec 28, 2018Jan 16, 2019
8Name 28,10,12Jan 21, 2019Feb 4, 2019Feb 22, 2019
9
10Name 38,10,12Dec 19, 2018Jan 2, 2019Jan 24, 2019Closed
11Name 48,10,12Jan 4, 2019Jan 18, 2019Feb 10, 2019
12Name 58,10,12Jan 25, 2019Feb 8, 2019Mar 2, 2019
13Name 68,10,12Feb 11, 2019Feb 25, 2019Mar 20, 2019
14
15Name 78,10,12Dec 7, 2018Dec 21, 2018Jan 11, 2019Closed
16Name 88,10,12,14Dec 24, 2018Jan 8, 2019Jan 30, 2019Closed
17Name 98,10,12Jan 10, 2019Jan 24, 2019Feb 15, 2019
18Name 108,10,12,14Feb 1, 2019Feb 15, 2019Mar 8, 2019
19
20Nane 118,10,12Dec 10, 2018Dec 24, 2018Jan 13, 2019Closed
21Name 128,10,12,14Jan 16, 2019Jan 30, 2019Feb 19, 2019
22
23Name 138,10,12Dec 14, 2018Dec 28, 2018Jan 20, 2019Closed
24Name 1410, 12Jan 2, 2019Jan 16, 2019Feb 6, 2019
25Name 158,10,12Jan 21, 2019Feb 4, 2019Feb 26, 2019
26Name 1610, 12Feb 7, 2019Feb 21, 2019Mar 15, 2019
27
28Name 178,10,12Dec 24, 2018Jan 7, 2019Jan 25, 2019Closed
29Name 188,9,10Jan 15, 2019Jan 29, 2019Feb 17, 2019
30text 123
31
32
33*text
34**text
35text
36
37text
38
39text
For acct mng
 
Upvote 0
If I understood correctly, do you just want to delete the rows of the "unsurprisingly" sheet? If it is correct, then use the following macro.


Code:
Sub Macro1()
    Application.ScreenUpdating = False
    Set h = Sheets("unsurprisingly")
    If h.AutoFilterMode Then h.AutoFilterMode = False
    u = h.Range("K" & Rows.Count).End(xlUp).Row
    h.Range("A6:K" & u).AutoFilter Field:=11, Criteria1:="Closed"
    Rows("7:" & u).Delete Shift:=xlUp
    If h.AutoFilterMode Then h.AutoFilterMode = False
    Application.ScreenUpdating = True
End Sub



Or you want to group all the sheets inside the sheet "unsurprisingly" but without the rows with the text "Closed".

Let me know any detail.
 
Upvote 0
If I understood correctly, do you just want to delete the rows of the "unsurprisingly" sheet? If it is correct, then use the following macro.


Code:
Sub Macro1()
    Application.ScreenUpdating = False
    Set h = Sheets("unsurprisingly")
    If h.AutoFilterMode Then h.AutoFilterMode = False
    u = h.Range("K" & Rows.Count).End(xlUp).Row
    h.Range("A6:K" & u).AutoFilter Field:=11, Criteria1:="Closed"
    Rows("7:" & u).Delete Shift:=xlUp
    If h.AutoFilterMode Then h.AutoFilterMode = False
    Application.ScreenUpdating = True
End Sub



Or you want to group all the sheets inside the sheet "unsurprisingly" but without the rows with the text "Closed".

Let me know any detail.

Works perfectly, 10^6 Thanks

Regards

hip
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,992
Members
449,094
Latest member
masterms

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top