ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to Cut & Paste Rows (https://www.excelbanter.com/excel-programming/289208-macro-cut-paste-rows.html)

Dominique Feteau

Macro to Cut & Paste Rows
 
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?



Otto Moehrbach[_6_]

Macro to Cut & Paste Rows
 
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
"Dominique Feteau" wrote in message
...
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?






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

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