Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If a value in varData occurs more than once, then delete all same values in varData and list remaining values in column F.
Values as either Integers or text or both, if possible. This code does not like the CountIf. Thanks. Howard Sub LoneValueStay() Dim varData As Variant Dim i As Long varData = Sheets("Sheet1").Range("A2:D15") '// Read in the data. For i = LBound(varData) To UBound(varData) If Application.WorksheetFunction.CountIf(varData(i, varData)) 1 Then varData(i) = "" 'varData(i).Delete End If Next i '// Write result to sheet. 'Sheets("Sheet1").Range("F1").Resize(UBound(varDat a) - LBound(varData) + 1, 1) _ = varData End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
if number occurs twice | Excel Discussion (Misc queries) | |||
How to calculate the Date occurs | Excel Worksheet Functions | |||
MsgBox when an Error occurs | Excel Discussion (Misc queries) | |||
How can I add up how often certain text occurs? | Excel Worksheet Functions | |||
Counting times a value occurs | Excel Programming |