I am trying to select cells in a table if another cell in the same table meets a certain condition, then copy the selected cells into a separate worksheet. I thought using an if then statement might workout best but Im sure there might be simpler ways to do this. I have tried two different options. I personally believe the second option is better than the first. But neither work.
Option 1
Dim Cell As Range
Dim EML As Range
For Each Cell In Worksheets("Project Directory").Range("Directory[OAC]")
For Each EML In Worksheets("Project Directory").Range("Directory[EMAIL]")
If Cell = "Y" Then
Worksheets("Data").Range("A1") = Worksheets("Project Directory").EML
End If
Next Cell
Option 2
If Worksheets("Sheet1").ListObjects("Table1").ListColumns(8).DataBodyRange = "Y" Then
Worksheets("Sheet2").Range("A1") = Worksheets("Sheet1").ListObjects("Table1").ListColumns(5)
End If