Producing a list if a column has a value Y
Solved/Closed
Related:
- Producing a list if a column has a value Y
- Counter strike 1.6 cheats list - Guide
- All contact number list with name - Guide
- How to change your best friends list on snapchat to 3 - Guide
- Amd crossfire compatibility list - Guide
- Whatsapp country code list - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Sep 20, 2010 at 09:22 AM
Sep 20, 2010 at 09:22 AM
Hi Russ,
Try this code:
Take note on the following:
2nd line of code: Range("A1:A5"). This is the range where a Y might be placed. Change the range according to your situation.
6th line of code: Sheets("Sheet2") this is the name of you second or destination sheet. Change the name according to your situation.
Does this suit your needs?
Best regards,
Trowa
Try this code:
Sub test() Set MyRng = Range("A1:A5") For Each cell In MyRng If cell.Value = "Y" Then cell.Offset(0, 1).Copy _ Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) End If Next End Sub
Take note on the following:
2nd line of code: Range("A1:A5"). This is the range where a Y might be placed. Change the range according to your situation.
6th line of code: Sheets("Sheet2") this is the name of you second or destination sheet. Change the name according to your situation.
Does this suit your needs?
Best regards,
Trowa
Sep 21, 2010 at 02:39 PM