Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Duplicate Count
I'm writing a macro that will loop through a table of data and count how many
duplicates there are on a given day as defined by user entered range. The code below works for the 1st date but displays 0 for the remaining dates. Any help would be appreciated. Dim enteredDate As Date 'Start Date entered by user Dim rawDataDate As Date 'Variable date as seen on BAS raw data ' Gets user inputed start date from main page enteredDate = Workbooks("QDS").Sheets("Sheet1").Cells(5, 3).Value ' Count of days between user selected start and end dates numDays = Workbooks("QDS").Sheets("Sheet1").Cells(7, 3).Value - _ Workbooks("QDS").Sheets("Sheet1").Cells(5, 3).Value For i = 1 To numDays dupecount = 0 Do While Cells(x, 2).Value < "" rawDataDate = Cells(x, 12).Value If Cells(x, 2).Value = Cells(y, 2).Value And DateDiff("d", rawDataDate,enteredDate) = 0 Then dupecount = dupecount + 1 End If x = x + 1 y = y + 1 Loop Workbooks("QDS").Sheets("Sheet2").Cells(i, 2).Value = dupecount enteredDate = enteredDate + 1 Next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Duplicate Count
Hello,
Maybe my UDF lfreq can serve as an example for you: http://www.sulprobil.com/html/listfreq.html Regards, Bernd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count Duplicate Numbers | Excel Worksheet Functions | |||
Count Duplicate Values | Excel Discussion (Misc queries) | |||
Count Number of Duplicate Occurances | Excel Worksheet Functions | |||
How do I do a count sum that ignores duplicate items | Excel Worksheet Functions | |||
get count of row without duplicate entries | Excel Worksheet Functions |