Sub Test()
For Each cel In Sheets("Sheet1").Range("C3:I8")
If cel.Value = 5229 Then Sheets("Sheet1").Range("A" & cel.Row).Copy Sheets("Sheet4").Cells(Rows.Count, "B").End(xlUp).Offset(1)
Next
End Sub
Good morning,
I would like to know how to write an IF statement that is capable to do the following:
=IF(C3:I8)(Sheet1) contains "5229" then copy A3 of same row(Sheet1) and paste to (Sheet4) B2
Any ideas?
Hi
C3:I8 contain cells that list a number. I've been using 5229 as an example. (several duplicates of numbers will be in this array but only one per cell)
A3:A8 contain peoples names. (no names are duplicated)
If C3:I8 contains 5229 then same row column A would be pasted on different sheet, say Sheet4 B2. If multiple names need to be placed in cell B2 could they appear as a list?
Row\Col | A | B | C | D | E | F | G | H | I |
3 | jack | 85 | 106 | 89 | 97 | 60 | 114 | 49 | |
4 | mark | 67 | 79 | 26 | 102 | 50 | 109 | 122 | |
5 | ian | 42 | 74 | 61 | 61 | 106 | 62 | 31 | |
6 | yan | 92 | 102 | 20 | 78 | 70 | 49 | 102 | |
7 | dave | 73 | 115 | 61 | 108 | 100 | 85 | 71 | |
8 | zack | 124 | 120 | 84 | 84 | 81 | 61 | 64 |
Row\Col | B |
1 | 61 |
2 | ian |
3 | dave |
4 | zack |
5 | |
6 |