Macro to Cut & Paste Rows

  • Thread starter Thread starter Dominique Feteau
  • Start date Start date
D

Dominique Feteau

Can someone help me with creating a macro that would look through rows of a
table (around 100) and if the value in a specific column (lets say G) was
equal to "1", it would cut and paste those entire rows to the bottom of the
sheet?
 
Dominique
This macro will do what you want. This macro assumes that your last row
of data is the same as the last entry in Column A, and the last column of
data is the same as the last entry in row 1. Modify this as needed. Watch
out for line wrap in this message. Expand this message to full screen to
see the code properly. HTH Otto
Sub CutNPaste()
Dim ColARng As Range
Set ColARng = Range("A1", Cells(Range("A" & Rows.Count).End(xlUp).Row, _
Range("IV1").End(xlToLeft).Column))
ColARng.AutoFilter Field:=7, Criteria1:="1"
ColARng.SpecialCells(xlCellTypeVisible).Copy _
Range("A" & Rows.Count).End(xlUp)(2)
ColARng.SpecialCells(xlCellTypeVisible).EntireRow.Delete
Range("A1").Select
End Sub
 
Back
Top