Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wanted to filter several columns for values that match a certain criteria.
Then I thought a copy/paste routine would work better (there are too many columns to use the filter tool). I found this simple cut/paste code on this DG a while back and I tried to use it today and it didnt do anything. Can someone please tell me why? Sub a() Dim Cell As Range Dim CutRg As Range For Each Cell In Sheet1.Range("AR1:BJ2000") If Cell.Value = "sam" Then If CutRg Is Nothing Then Set CutRg = Cell.EntireRow Else Set CutRg = Union(CutRg, Cell.EntireRow) End If End If Next If Not CutRg Is Nothing Then CutRg.Copy Sheet2.Range("A1") CutRg.Delete End If End Sub There may be multiple instances of the value sought in multiple columns/rows. I am hoping to copy the entire row if even one instance of the value is found. Thanks, Ryan--- -- RyGuy |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find values in multiple cells and paste row values | Excel Discussion (Misc queries) | |||
Copy Paste Values - Entire Workbook and Save | Excel Discussion (Misc queries) | |||
code to FIND value, copy, paste values onto other sheet | Excel Programming | |||
Can you copy multiple tabs from formulas to values w/o paste spec? | Excel Worksheet Functions | |||
multiple search criteria to find and copy from sheet1 and paste into sheet2 | Excel Programming |