Delete rows from current month

vicvallejo10

New Member
Joined
May 18, 2020
Messages
2
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
Platform
  1. Windows
Hi there,
I have a file with historic data which is weekly updated with a Month to date raw data can anybody help me to delete rows only from the current month? Date is on column B
1589841322907.png


And on column AC I have a =MONTH(B3) formula.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hello Victoria,

If you mean just dates for the current month of May, mixed in with dates from other months, then this may help:-

VBA Code:
Sub Test()

Application.ScreenUpdating = False

        With Sheet1.Range("B2", Sheet1.Range("B" & Sheet1.Rows.Count).End(xlUp))
                .AutoFilter 1, 7, 11
                .Offset(1).EntireRow.Delete
                .AutoFilter
        End With

Application.ScreenUpdating = True

End Sub

The code needs to be placed in a standard module and assigned to a button.

I've used Sheet1 (the sheet code) not the sheet name in the above code. You may need to change this to suit.

The code won't require the help of the =MONTH formula.

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Hi vcoolio, thank you for taking the time to help me I really appreciate it.

Yes from the current month, I think it is not working, an error appeared.

I changed Sheet1 to DGMPStoreScore tab and assigned it to Delete prior button but it was not sucessfull. Any other ideas?

1589902769689.png
 
Upvote 0
Hello Victoria,

This is totally different from your opening post.

Are you deleting rows of data from the Dashboard sheet or the DGMP Store Score sheet? If it is the DGMP Store Score sheet, is it set out as per the image in your opening post?

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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