Search Attendance Sheet to see if people who registered attended (by their email) and set a cell to yes or no value

mminten75

New Member
Joined
Mar 16, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am looking for a way to search from one cell in my registration sheet and see if the string in that cell appears in column in an attendance sheet (to see if they showed up). If so I would like to just have the word Yes appear in Column T of the registration sheet. I would like to do this in VBA as part of my reporting software.

I currently use this formula in Column T of the registration sheet: =IF(ISNA(VLOOKUP(W2,'Attendance'!D:D,1,FALSE)),"no", "yes")
This will search for the email address in W2 in Column D of the attendance worksheet. If it exists it will place a "yes" in the cell where this formula appears.

How can I do this in VBA using a For Next command for each row?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You will have to tweak it for your purposes, but this should work if you put it in the code area of whatever worksheet, you want the answers

VBA Code:
Sub FindAttendees()
For R = 2 To WhateverRowYouWantToEndAt
    If (IsError(WorksheetFunction.VLookup(Range(Cells(R, 23), Worksheets("Attendance").Range("D:D"), 1, False)))) Then
        Cells(R, WhateverColumnYouWant) = "No"
        Else
        Cells(R, WhateverColumnYouWant) = "Yes"
    End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top