Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default non duplicate values

Hi Everyone,
I have a following formula in D1
"=IF(COUNTIF($A$1:$B$20,A1)=1,A1,"")"
but is there a way when the A1<1 look for next row. my unique list
aray is d1-d20. so far i tried following but I am very confused and the
code is not working of course:) And I have been posting almost similar
questions log time but no one replies. I`m assuming before I was not
very clear. If the question is not clear kindly reply me to clarify....
Dim x, n
Dim ncell
For n = 1 To 19
ncell = Sheet2.Range("b" & n)
x = Application.WorksheetFunction.CountIf(Sheet1.Range ("a1:b10"),
ncell)
If x = 1 Then
Sheet2.Range("d" & n) = Sheet2.Range("b" & n)
n = n + 1
End If
Next
can anyone help me?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default non duplicate values

Sorry I did not carefully check the forum. Actually there is a similar
question posted previously. It was replied by Mr. Tom which is
perfectly working for me. So my question's answer is as follows.
Thanks a lot.


Dim rng As Range, rw As Long
Dim rngA As Range, cell As Range
Set rngA = Range(Cells(1, "A"), Cells(Rows.Count, "A").End(xlUp))
Set rng = Range(Cells(1, "B"), Cells(Rows.Count, "B").End(xlUp))
rw = 1
For Each cell In rng
If Application.CountIf(rngA, cell.Value) = 0 Then
Cells(rw, "E").Value = cell.Value
rw = rw + 1
End If
Next
_________________________________________
wrote:
Hi Everyone,
I have a following formula in D1
"=IF(COUNTIF($A$1:$B$20,A1)=1,A1,"")"
but is there a way when the A1<1 look for next row. my unique list
aray is d1-d20. so far i tried following but I am very confused and the
code is not working of course:) And I have been posting almost similar
questions log time but no one replies. I`m assuming before I was not
very clear. If the question is not clear kindly reply me to clarify....
Dim x, n
Dim ncell
For n = 1 To 19
ncell = Sheet2.Range("b" & n)
x = Application.WorksheetFunction.CountIf(Sheet1.Range ("a1:b10"),
ncell)
If x = 1 Then
Sheet2.Range("d" & n) = Sheet2.Range("b" & n)
n = n + 1
End If
Next
can anyone help me?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate values [email protected] Excel Discussion (Misc queries) 3 April 6th 07 01:03 AM
DUPLICATE VALUES Saintsman Excel Worksheet Functions 2 October 12th 05 05:21 PM
Duplicate values Louise Excel Worksheet Functions 6 April 15th 05 03:39 PM
Duplicate values Tom Ogilvy Excel Programming 0 July 20th 03 04:43 PM
Duplicate values Bob Phillips[_5_] Excel Programming 0 July 20th 03 04:21 PM


All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"