View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default 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