Need VBA to automatically copy paste rows based on dates of current month.

pk970

New Member
Joined
Apr 2, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I would like to develop a VBA code which copies rows from sheet 1 based on date column & paste it in another sheet. It shall only copy rows whose date falls in current month. I have 2 requirements. My excel workbook has over 15 tabs and its a heavy file.

1) I have a sheet lets name it sheet 2, it consists of a data column which consists much older dates. I need first to delete rows which has dates of current month i.e. if the date is of April 2024 then I need to delete all rows.

2) I have another sheet which consists of a date column and date range is very vast i.e. it has date which goes back to the year 2000. I need to copy only specific rows which has falls in current month i.e. I need to copy rows whose date is April 2024 and paste those same rows in sheet 2.

I am very new to VBA and I got this situation in my project. A full code would be really helpful.
Thank You in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Is the macro I suggested in Post #5 working for you now?
It worked partially. But then our requirement changed.
Initially we had a date column but then client said that they don't want to go with date column but they had a derivate column for Fiscal month i.e. a column where date was converted into "Jan-24", "March-24" format but the source of that date column was not known. So we are working on that.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
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