Check if a person exists in a distribution list

  • Thread starter Thread starter k1sr
  • Start date Start date
K

k1sr

I'm trying to create some validation in Excel which will check if the user
exists in a specific PDL...

Is this possible, and how do I do it...?

I'm just after VBA code to check the user against the PDL, then return True
or False
 
why not try this formula:

=COUNTIF(your_PDL_range,user)


in VBA, select your column with data, then run the macro (it will
insert "TRUE" one cell to the right from the cell containing user name
if the user is in the list):

Sub test()
Dim cell as Range
For Each cell in Selection
If Application.Worksheetfunction.Countif(Selection,cell.value)>0 Then
cell.Offset(0,1) = "TRUE"
End if
Next cell
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top