LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Find Multiple Values, Copy Entire Row & Paste

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
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
find values in multiple cells and paste row values izzyt1972 Excel Discussion (Misc queries) 5 December 26th 07 10:14 PM
Copy Paste Values - Entire Workbook and Save Scott Campbell[_2_] Excel Discussion (Misc queries) 1 August 9th 07 07:53 PM
code to FIND value, copy, paste values onto other sheet ufo_pilot Excel Programming 2 December 6th 05 04:14 PM
Can you copy multiple tabs from formulas to values w/o paste spec? Brent Excel Worksheet Functions 2 October 27th 05 12:47 AM
multiple search criteria to find and copy from sheet1 and paste into sheet2 lothario[_54_] Excel Programming 2 November 25th 03 09:57 AM


All times are GMT +1. The time now is 06:24 AM.

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"