Archive rows from one worksheet to another, based on the value of a cell in each row

  • Hi all


    I have a worksheet that I would like to move the contents of a row to another sheet based on the cell content in column 'K' = "yes", effectively archiving any jobs that have been invoiced. A VBA code that I can attach to a form control button would be ideal.
    A sample spreadsheet has been attached so any help offered would be appreciated.


    Thanks Phil

  • Hi Jonathan


    Firstly, thanks very much for the quick reply....awesome.


    Your code is very nearly there, and the bit it doesn't do is because I wasn't clear in my explanation. Is it possible to have it delete from the original worksheet "DRS REGISTER" after it has been pasted to the "ARCHIVE"? And also, it leaves the drop down on the DRS register active when it's complete...is it possible to have it show the whole sheet again?


    Sorry if I wasn't clear.


    Thanks again


    Phil

  • It should do both of those things. The .EntireRow.Delete line deletes the row that was moved, and the .Range.AutoFilter Field:=11 line removes the filter. Are you sure you copied all the above code?

  • Please give this a try...


    Click the button called "Copy To Archive " on DRS Register Sheet to run the code.


    [ATTACH]n1207666[/ATTACH]

  • [USER="329544"]JonathanVH[/USER] and [USER="304523"]sktneer[/USER] , sorry for the late reply but thank you both for your help....they both work a treat. I had a conflict within data validation lists, and that's why yours didn't work initially [USER="329544"]JonathanVH[/USER] , nothing to do with your code. Thank you both again, really appreciated :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!