Extracting matched observation and its corresponding row
Closed
Abhi88
-
5 Feb 2016 à 04:18
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 9 Feb 2016 à 11:47
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 9 Feb 2016 à 11:47
Related:
- Extracting matched observation and its corresponding row
- Saints row 2 cheats - Guide
- How to delete a row in word - Guide
- Saints row pc download - Download - Action and adventure
- Vb net find last row in excel sheet - Guide
- Extracting audio from video vlc - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
9 Feb 2016 à 11:47
9 Feb 2016 à 11:47
Hi Abhi88,
In the code below the source sheet is refered to as Sheet1 and the destination sheet as Sheet2.
Make sure both sheets are present in your workbook and named accordingly. Or adjust the sheet names in the code (Sheet1 is found on code line 4, Sheet2 is found on code line 9).
Here is the code:
Best regards,
Trowa
In the code below the source sheet is refered to as Sheet1 and the destination sheet as Sheet2.
Make sure both sheets are present in your workbook and named accordingly. Or adjust the sheet names in the code (Sheet1 is found on code line 4, Sheet2 is found on code line 9).
Here is the code:
Sub RunMe()
Dim mCell As Range
Sheets("Sheet1").Select
For Each cell In Range("AA2:AA" & Range("AA" & Rows.Count).End(xlUp).Row)
Set mCell = Columns("A:A").Find(cell.Value)
Range(Range("A" & mCell.Row), Range("K" & mCell.Row)).Copy _
Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Next cell
End Sub
Best regards,
Trowa