ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   when condition is true, move row to end of different sheet (https://www.excelbanter.com/excel-programming/324823-when-condition-true-move-row-end-different-sheet.html)

Gran

when condition is true, move row to end of different sheet
 
would be grateful if anyone can help
i have a list of orders and if i type complete (or something) in a cell i
want the whole row to be moved to the end of another sheet

Ben

when condition is true, move row to end of different sheet
 


"Gran" wrote:

would be grateful if anyone can help
i have a list of orders and if i type complete (or something) in a cell i
want the whole row to be moved to the end of another sheet



private sub worksheet_change(ByVal Target As Excel.Range)
columnt = target.column
rowt = trim(str(target.row))
if columnt = 17 then goto moverow'say this is the column you type 'complete'
in
exit sub
moverow:
rows(rowt).cut
sheet2.activate 'this being the sheet you want to move it to
rowtomoveto = str(trim(sheet2.usedrange.rows.count +1))
rows(rowtomoveto).select
activesheet.paste
sheet1.activate 'Return you to your original sheet
end sub






All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com