Solved

Find and move rows

Posted on 2012-12-27
10
189 Views
Last Modified: 2012-12-29
I need help with a macro that can check sheet 1 which has content as this


http://i72.photobucket.com/albums/i173/or.jpg
http://i72.photobucket.com/albums/i173/ssor.jpg
http://i72.photobucket.com/albums/i173/rror.jpg

Column A has this

Sheet 2 has many columns of data and many rows

Need to search full content and move the complete row if found as column A of sheet 1 to sheet 3

Whole row should be copied or cut either ways is fine with me
0
Comment
Question by:bsharath
  • 5
  • 4
10 Comments
 
LVL 2

Expert Comment

by:hanklm
ID: 38726003
FYI:  The image links don't seem work - at least not for me.

I get redirected here: http://beta.photobucket.com/browse?httpstatus=404

Maybe it's just a temporary issue?
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38726008
It would be better if you upload the files on experts-exchange.

Better still if you can upload an excel file (possibly fictitious) so that direct testing could be done instead of rebuilding the data.
0
 
LVL 11

Author Comment

by:bsharath
ID: 38726023
The links are dummy that i placed

These URl's 100's will be in sheet1 column A

Find each in sheet 2 and copy full row to sheet 3
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 11

Author Comment

by:bsharath
ID: 38726309
Any help with this please?
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38726311
Please throw in a sample file to work on.
0
 
LVL 11

Author Comment

by:bsharath
ID: 38726345
Please find attached sample file
Sample.xls
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 38726589
Here you go

Sub getfoundurls()
    Dim cel As Range, fs2 As Range
    For Each cel In Sheet1.UsedRange.Columns(1).Cells
        Set fs2 = Sheet2.UsedRange.Find(cel, , , xlWhole)
        If Not fs2 Is Nothing Then
            fs2.EntireRow.Copy Sheet3.Cells.SpecialCells(xlCellTypeLastCell).Offset(1).EntireRow
        End If
    Next cel
End Sub
0
 
LVL 11

Author Comment

by:bsharath
ID: 38726648
Thanks

Anyway i can color sheet 1 cells whose content is not found in sheet 2 and was skipped
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38726658
Try this .... not tested
Sub getfoundurls()
    Dim cel As Range, fs2 As Range
    For Each cel In Sheet1.UsedRange.Columns(1).Cells
        Set fs2 = Sheet2.UsedRange.Find(cel, , , xlWhole)
        If Not fs2 Is Nothing Then
            fs2.EntireRow.Copy Sheet3.Cells.SpecialCells(xlCellTypeLastCell).Offset(1).EntireRow
        else 
            cel.interior.color = 255
        End If
    Next cel

Open in new window

End Sub
0
 
LVL 11

Author Comment

by:bsharath
ID: 38728977
Thank you
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question