Auto transferring expired rows to 2nd worksheet

MrCameronExcel

New Member
Joined
Apr 21, 2017
Messages
43
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am looking for some help creating VBA code that will transfer expired rows from the first worksheet - called "Valid Clearances" - to the second worksheet - called "Expired Clearances"

I initially troubleshooted this issue via google, but the codes I found never worked when I tried to apply them.

Below is a sample table of what both worksheets look like.

The first two rows of both worksheets will remain the same, but I would like to apply a code so that every time I open the workbook, it automatically moves expired rows - based on the expiry date column (J) - to the bottom of the table on the second worksheet (Expired Clearances).

Any help is appreciated!


[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Original Record[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Internal Record[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ARSC[/TD]
[TD]Batch #[/TD]
[TD]Ref. #[/TD]
[TD]Legal Company Name[/TD]
[TD]Last Name[/TD]
[TD]First Name[/TD]
[TD]Person Type[/TD]
[TD]Assigned To[/TD]
[TD]Status[/TD]
[TD]Expiry Date[/TD]
[TD]Submit date[/TD]
[TD]primary[/TD]
[TD]current company name[/TD]
[TD]current status[/TD]
[TD]telephone[/TD]
[TD]email[/TD]
[TD]notes[/TD]
[/TR]
[TR]
[TD]442[/TD]
[TD]B-8388[/TD]
[TD]C-4848[/TD]
[TD]Company A[/TD]
[TD]Chad[/TD]
[TD]Chad[/TD]
[TD]Worker[/TD]
[TD]Cam[/TD]
[TD]Granted[/TD]
[TD]9/23/2017[/TD]
[TD]9/21/2017[/TD]
[TD]cam[/TD]
[TD]Company A[/TD]
[TD]Worker[/TD]
[TD]444-444-4444[/TD]
[TD]sample@sample.com[/TD]
[TD]sample notes[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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