?
Solved

Find and move rows

Posted on 2012-12-27
10
Medium Priority
?
198 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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 2000 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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