MrCameronExcel
New Member
- Joined
- Apr 21, 2017
- Messages
- 43
- Office Version
- 365
- Platform
- 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]
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]