Assigning macro to Command Button for archiving

ada111

Board Regular
Joined
Feb 19, 2015
Messages
74
I created a Command button and need to assign a code to it. I have two sheets "Active" and "Archive". I have data in "Active" in cells B11:J33. This spreadsheet has a new entry button that adds rows whenever clicked so the cells will have data extending past row 33. I need a macro that begins with:

Private Sub CommandButton3_Click()

And I need it to be a button that when clicked, data that is over 90 days old is automatically put in the Archive sheet starting at B11:J11. I need column J to be what determines if the data is over 90 days old. That column is the Patient Notification Date. So if the date in that column is over 90 days old, then the entire row is transferred to the Archive section.

So here's the information I have:
I have data in B11:J33 right now but it will past row 33 when new entries are added.
When the date is over 90 days old, the entire row is transferred to the Archive page starting at B11:J11
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,203,727
Messages
6,056,966
Members
444,899
Latest member
Excel_Temp

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