I have 5 columns each representing a meeting with a list of up to 300 attendee names in each column
I would like to use a macro to list in column 6 the names of those who have attended only 1 of the 5 meetings
Thank you for your help
I have 5 columns each representing a meeting with a list of up to 300 attendee names in each column
I would like to use a macro to list in column 6 the names of those who have attended only 1 of the 5 meetings
Thank you for your help
Can you upload an example workbook showing your layout of data structure and your expected output?
Thanks,
Mike
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved.
Hi,
The following code will interrogate the cells in the range A1:E11 and generate a list in column H of values that only occur once in that range.
![]()
Sub a() Dim rSource As Range Dim rCell As Range Dim iCount As Integer Set rSource = Range("A1:E11") For Each rCell In rSource If Application.WorksheetFunction.CountIf(Range("H:H"), rCell.Value) = 0 And Application.WorksheetFunction.CountIf(rSource, rCell) = 1 Then Range("H" & Rows.Count).End(xlUp).Offset(1, 0).Value = rCell.Value End If Next rCell End Sub
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
Thanks for that. Can I ask a couple of questions. Why the countIf (Range("H:H") and can the list in column H start at row 1 instead of row 2?
Error posting. Apologies
Last edited by Logit; 12-20-2016 at 06:28 PM.
The CountIf(H:H is there to check that the current cell isn't in the unique list already.
To corrct the row that the unique list occupies, replace this:
with this:![]()
Range("H" & Rows.Count).End(xlUp).Offset(1, 0).Value = rCell.Value
![]()
If Range("H1").Value = "" Then Range("H1").Value = rcell.Value Else Range("H" & Rows.Count).End(xlUp).Offset(1, 0).Value = rcell.Value
that's great thank you. I'm happy with this so will close
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks