Search column for text "X" then copy to
Closed
shannon
-
Feb 29, 2012 at 09:41 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 6, 2012 at 10:04 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 6, 2012 at 10:04 AM
Related:
- Search column for text "X" then copy to
- Yahoo search history - Guide
- How to search for words on a page - Guide
- Safe search settings - Guide
- How to search google usa - Guide
- How to search nearby friends on facebook - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Mar 6, 2012 at 10:04 AM
Mar 6, 2012 at 10:04 AM
Hi Shannon,
Try this code:
Please adjust sheet names ("Main" and "Dest") to match yours.
Best regards,
Trowa
Try this code:
Sub test() Dim lRow, lRow2 As Integer lRow = Sheets("Main").Range("B" & Rows.Count).End(xlUp).Row For Each cell In Sheets("Main").Range("B2:B" & lRow) If cell.Value = "X" Then lRow2 = Sheets("Dest").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row cell.Copy Destination:=Sheets("Dest").Range("A" & lRow2) cell.Offset(0, -1).Copy Destination:=Sheets("Dest").Range("B" & lRow2) End If Next cell End Sub
Please adjust sheet names ("Main" and "Dest") to match yours.
Best regards,
Trowa