Accept/Reject values in Excel cells

loopoo

New Member
Joined
Nov 10, 2005
Messages
43
Hello!

I hev the following problem: I want, in a cell, to be able to select a value that is in list1, but not in list2 (list1 contains the values in list2).

Can anyone help me with that?

Thanks in advance,
Chris
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
suppose list1 is the range name for entries in column A
list2 is range name in columnC

if you run this sub the items in list 1 not in llist2 will be copied in column F
modify to suity you


Public Sub test()
Dim findc As Range
Dim cell As Range
Dim i As Integer
For Each cell In Range("list1")
With Range("list2")
Set findc = .Find(cell)
End With
If Not findc Is Nothing Then GoTo line1
cell.Copy Destination:=Range("f1").Offset(i, 0)
i = i + 1
line1:
Next
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,118,229
Messages
5,571,019
Members
412,354
Latest member
Stj99
Top