Copy rows of cells dependent on expiry dates(or colour of cells) to a new sheet

benignmalice

New Member
Joined
Dec 13, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I have been struggling for quite a while now to figure out a way to automatically copy and paste rows of data (according to an expiry date or colour of a cell) to new sheets. I have seen a few macros for similar problems posted but haven't been able to get them to work with my spreadsheet.

I have a spreadsheet of medication stock. What I need to do is copy the medication rows which are currently expired to a new sheet, I also need to copy the medications that are going to expire within 2 months to a different sheet, and finally the medication expiring between 2 - 4months to a different sheet. The expiry date cell has been conditionally formatted to change colour depending on the duration to the expiry date. Is it possible to automatically copy and paste cells dependent on their colour?

I have another sheet of medical consumables which I have to do the same thing with but is has a different cell number with the expiry date.

Please could someone kindly assist me with a macro or give me pointers on how to go about getting this done. It would be massively appreciated!

I hope this explanation is clear enough. If you need any further info please let me know.
 

Attachments

  • 2021-12-13 (4).png
    2021-12-13 (4).png
    242.1 KB · Views: 41
  • 2021-12-13 (3).png
    2021-12-13 (3).png
    254.6 KB · Views: 42

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi, please use XL2BB tool to share your data. It would help to provide solution quickly.

thanks,
Saurabh
 
Upvote 0
Hi,

Thanks for the reply. I am unfortunately not able to share the document as it is work related. What other information do you need to make it easier to assist?
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,381
Members
448,888
Latest member
Arle8907

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