Automatically Cut Row of Data and Paste to Other Sheet?

D

D

Hey guys-
You have all been soo wonderful about helping me out on the other issues- I
decided to throw this one at you...

I have searched newsgroups, this forum, etc, and see references to this, but
not to do exactly as I need done. So maybe someone can throw me in the right
direction here...

I have a column of numeric values. IF the cell value is negative or less
than zero, I want the entire ROW that it sits on cut and pasted onto the
worksheet named 'Check Status' within the sale file. This row(s) would be
pasted to the first available cell on that sheet. I would like this all done
automatically. How do I do this?
Thank you soo much in advance!
D
 
P

papou

Hello D
Have a try with this non-tested sample code (you will need to amend
accordingly with sheet names and ranges)
The following code will filter sheet "Feuil1" (data from column A to E)
with criteria for values in column C less then zero
It will then cut the filtered rows and paste them onto sheet "Feuil2"
starting from the first available row in colmun A.

Dim LastRow As Long
LastRow = Worksheets("Feuil1").Range("A65536").End(xlUp).Row
Worksheets("Feuil1").Range("C:C").AutoFilter Field:=1, Criteria1:="<0"
Application.DisplayAlerts = False
Worksheets("Feuil1").Range("A2:E" &
LastRow).SpecialCells(xlCellTypeVisible).Cut
Worksheets("Feuil2").Range("A65536").End(2).Paste
Application.DisplayAlerts = True
Application.CutCopyMode = False
Worksheets("Feuil1").Range("C1").AutoFilter

HTH
Regards
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top