VBA Code
Closed
Elly
-
4 Feb 2009 à 11:52
melnisson Posts 12 Registration date Saturday 30 August 2008 Status Member Last seen 31 March 2009 - 4 Feb 2009 à 14:07
melnisson Posts 12 Registration date Saturday 30 August 2008 Status Member Last seen 31 March 2009 - 4 Feb 2009 à 14:07
Related:
- VBA Code
- Cs 1.6 code - Guide
- Vba case like - Guide
- Find vba - Guide
- Vba timer - Guide
- Tetris unlock code ✓ - Android Forum
1 response
melnisson
Posts
12
Registration date
Saturday 30 August 2008
Status
Member
Last seen
31 March 2009
4
4 Feb 2009 à 14:07
4 Feb 2009 à 14:07
hi,
try this:
Set r = [A1] 'First cell of column with names to look for
Set r2 = [B1:B100] 'First cell of column with names to look in
Set r3 = [C1] 'New column created with names that do not exist in column B
Do Until r = ""
For Each rFound In r2
If rFound.Value = r.Value Then
NameFound = ""
Exit For
End If
If rFound.Value <> r.Value Then
NameFound = r.Value
End If
Next rFound
If NameFound <> "" Then
r3.Value = NameFound
Set r3 = r3.Offset(1, 0)
End If
NameFound = ""
Set r = r.Offset(1, 0)
Loop
i hope that it works for you.
try this:
Set r = [A1] 'First cell of column with names to look for
Set r2 = [B1:B100] 'First cell of column with names to look in
Set r3 = [C1] 'New column created with names that do not exist in column B
Do Until r = ""
For Each rFound In r2
If rFound.Value = r.Value Then
NameFound = ""
Exit For
End If
If rFound.Value <> r.Value Then
NameFound = r.Value
End If
Next rFound
If NameFound <> "" Then
r3.Value = NameFound
Set r3 = r3.Offset(1, 0)
End If
NameFound = ""
Set r = r.Offset(1, 0)
Loop
i hope that it works for you.