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 January 16, 2023 - Mar 6, 2012 at 10:04 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Mar 6, 2012 at 10:04 AM
Related:
- Search column for text "X" then copy to
- Www.google.com search video - Download - Video playback
- Vim search for word - Guide
- How to search a youtube channel - Guide
- Vba find column by name ✓ - Excel Forum
- Yahoo search history - Guide
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
544
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