This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
[VBA] Xlookup with multiple criterias advice
Post Flair (click to view more posts with a particular flair)
Author Summary
Admirable-Length178 is
in
VBA
Post Body
0
Hi I am trying to do a xLookup on emails in different columns to check for duplicates.Basically the first line of code works but I'm unable to create condition for other columns.
For example, if Range("E1:E6").Valueis empty then lookup in range b and return any email dupes in that range. If not move on to range c and so on.
Here is the current code
Sub lookup()
Dim result AS Boolean
result = Range("E2:E6").Value
Range("E2:E6").Value = Application.XLookup(Range("D2:D6"), Range("A:A"), Range("A:A"))
If IsError(Range("E2:E6")).Value Then Range("E2:E6").Value = Application.XLookup(Range("D2:D6"), Range("B:B"), Range("B:B"))
Else Range("E2:E6").Value = Application.XLookup(Range("D2:D6"), Range("C:C"), Range("C:C"))
End If
End Sub
Thanks all for the help
Author
Account Strength
100%
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
32,527
Link Karma
14,143
Comment Karma
18,384
Profile updated: 5 days ago
Posts updated: 1 month ago
Subreddit
Post Details
Location
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/vba/comment...