Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 4, 5:53*pm, Tom Hutchins
wrote: Try this Worksheet_Change event code. I named the range which should have no duplicate values UniqRng in this example. Private Sub Worksheet_Change(ByVal Target As Range) Dim tgt As Range, xx As Range For Each tgt In Target * * If (Not Intersect(tgt, ActiveSheet.Range("UniqRng")) Is Nothing) And _ * * * * (Len(tgt.Value) 0) Then * * * * For Each xx In ActiveSheet.Range("UniqRng") * * * * * * If xx.Address < tgt.Address Then * * * * * * * * If xx.Value = tgt.Value Then * * * * * * * * * * xx.Value = vbNullString * * * * * * * * End If * * * * * * End If * * * * Next xx * * End If Next tgt End Sub This code should be placed on the code page of the worksheet where you want this to work. Hope this helps, Hutch This worked perfectly. Thank you very much.! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculating the number of unique values with a range | Excel Discussion (Misc queries) | |||
Unique values from date range | Excel Discussion (Misc queries) | |||
How do I get the unique values from a range? | Excel Worksheet Functions | |||
Sum Unique Values Across SpecialCellType Visible Range. | Excel Programming | |||
Display unique values in a range. | Excel Programming |