Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default 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?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO PASTE CELL to COLUMN, SKIP ROWS Dan Excel Discussion (Misc queries) 1 February 2nd 10 01:03 PM
A macro to copy & paste many rows (a range) to the next column .. genehunter New Users to Excel 11 April 21st 09 07:36 AM
Paste rows in macro murphy Setting up and Configuration of Excel 1 August 20th 08 11:03 PM
Macro to find and paste rows kayabob Excel Discussion (Misc queries) 4 February 21st 07 01:50 AM
Macro to: Find a Reference, and then Paste into the 10 Rows Below Blobbies Excel Discussion (Misc queries) 9 March 14th 06 11:17 AM


All times are GMT +1. The time now is 07:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"