Comparing data in 3 columns on a Microsoft Excel spreadsheet
Solved/Closed
daniz39
Posts
1
Registration date
Tuesday 17 March 2015
Status
Member
Last seen
17 March 2015
-
17 Mar 2015 à 11:08
daniz39 - 23 Mar 2015 à 13:16
daniz39 - 23 Mar 2015 à 13:16
Would be really grateful for some help.
I have 3 columns of different lengths with email addresses in them and I want to see all instances where the same email address appears in all 3 columns. Can't work out how to do it though.
Any advice much appreciated. Thanks.
I have 3 columns of different lengths with email addresses in them and I want to see all instances where the same email address appears in all 3 columns. Can't work out how to do it though.
Any advice much appreciated. Thanks.
Related:
- Comparing data in 3 columns on a Microsoft Excel spreadsheet
- Hitman 3 cheats - Guide
- Psiphon 3 download - Download - VPN
- Five nights in anime 3 - Download - Adult games
- Display two columns in data validation list but return only one - Guide
- Hitman 3 free download - Download - Action and adventure
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Moderator
Last seen
27 December 2022
555
23 Mar 2015 à 13:12
23 Mar 2015 à 13:12
Hi Daniz,
The following code will loop through column A and compare them to columns B and C. If a value from column A is found in both column B and C then the value is pasted in the next available cell of column D.
Check the column references in the code and adjust them to suit your situation. Let us know if you get stuck.
Here is the code:
Best regards,
Trowa
Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
The following code will loop through column A and compare them to columns B and C. If a value from column A is found in both column B and C then the value is pasted in the next available cell of column D.
Check the column references in the code and adjust them to suit your situation. Let us know if you get stuck.
Here is the code:
Sub RunMe() Dim cFind As Range Dim IsThere As Boolean Dim lRow As Integer lRow = Range("A" & Rows.Count).End(xlUp).Row For Each cell In Range("A1:A" & lRow) Set cFind = Columns("B:B").Find(cell.Value) If Not cFind Is Nothing Then IsThere = True Set cFind = Columns("C:C").Find(cell.Value) If Not cFind Is Nothing And IsThere = True Then IsThere = True Else IsThere = False End If If IsThere = True Then Range("D" & Rows.Count).End(xlUp).Offset(1, 0) = cell.Value Next cell End Sub
Best regards,
Trowa
Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
23 Mar 2015 à 13:16