Hi, I am looking to loop through 20 columns of emails to see if they exist in an an array of excluded emails.
I have 23 columns, example below. The Validation column is after the 20 columns of emails so would be column number 23 (Col W).
some of the columns are blank so these need to be skipped.
I was planning to do this with a Do While, but I am still just learning loops and haven't used an array before.
I got this far and thought that I'd ask for help
I have 23 columns, example below. The Validation column is after the 20 columns of emails so would be column number 23 (Col W).
some of the columns are blank so these need to be skipped.
I was planning to do this with a Do While, but I am still just learning loops and haven't used an array before.
I got this far and thought that I'd ask for help
VBA Code:
Sub Email_Validation()
Dim i As Integer
i = 1
Dim MyArray() As Variant
MyArray = Worksheet(2).Range("A1").CurrentRegion
Do While Cells(i, 3).Value <> MyArray
Loop
ID Number | Original Emails | Email 1 | Valid Email (Y/N) |
1234567891234 | email@email.com email1@email.com | Checks the 3rd column to see if it exists in the designated array, if not = "Y" and exit loop. If it does match it needs to check the next column until it finds a value that does not match the array or if it gets to the end and they all match it needs to return "N" |