Home |
Search |
Today's Posts |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To make it simpler i can dump all the data into one sheet and work with that.
Let me know if that will make the code simpler. Thanks. "Versace77" wrote: GTVT06, Sorry, I forgot to mention where it is hanging up. It is hanging up near the end "If Dupe < "" And Dupe = Dupe2 Then..." Thanks! "Versace77" wrote: Thanks for the updated code. When attempting to run the macro here's what happens: Macro makes the summary sheet active, hourglass appears for 10 or so seconds and then nothing. Just a blank sheet. I'll forward you the .xls that i'm using so you can get an idea or maybe see something that is missing. Thanks again GTV. Mike "GTVT06" wrote: Ok, heres the revised code. Inside the commented box change "Summary" to whatever the actual summary sheet name is, change "U" to the letter of the column that you would like to use to show the number of instances, and change "2" to the number of the row in which the data starts in.(i.e. I entered 2 assuming there was one row of headers and data begins in row 2). Let me know if this works for you or if you have any questions. Sub Test() Dim cell, cell2 As Range Dim Dupe, Dupe2 As String Dim LRow, LRow2, i, i2, DRow As Long Dim n, DCol As String '=================================== n = "Summary" 'Name Of Summary Sheet DCol = "U" 'Column to show count DRow = 2 'Row to begin count '=================================== Worksheets(n).Activate LRow = Worksheets(n).Range("A65536").End(xlUp).Row Worksheets(n).Range(DCol & DRow & ":" & DCol & LRow).ClearContents For Each cell In Worksheets(n).Range("A" & DRow & ":A" & LRow) i = cell.Row Dupe = Worksheets(n).Range("A" & i).Value & Worksheets(n).Range("B" & i).Value & Worksheets(n).Range("C" & i).Value _ & Worksheets(n).Range("D" & i).Value & Worksheets(n).Range("E" & i).Value & Worksheets(n).Range("F" & i).Value _ & Worksheets(n).Range("G" & i).Value & Worksheets(n).Range("H" & i).Value & Worksheets(n).Range("I" & i).Value _ & Worksheets(n).Range("J" & i).Value & Worksheets(n).Range("K" & i).Value & Worksheets(n).Range("L" & i).Value _ & Worksheets(n).Range("M" & i).Value & Worksheets(n).Range("N" & i).Value & Worksheets(n).Range("O" & i).Value _ & Worksheets(n).Range("P" & i).Value & Worksheets(n).Range("Q" & i).Value & Worksheets(n).Range("R" & i).Value _ & Worksheets(n).Range("S" & i).Value & Worksheets(n).Range("T" & i).Value Dim n2 As Single For n2 = 1 To Sheets.Count If Worksheets(n2).Name = Worksheets(n).Name Then GoTo nx LRow2 = Worksheets(n2).Range("A65536").End(xlUp).Row For Each cell2 In Worksheets(n2).Range("A1:A" & LRow2) i2 = cell2.Row Dupe2 = Worksheets(n2).Range("A" & i2).Value & Worksheets(n2).Range("B" & i2).Value & Worksheets(n2).Range("C" & i2).Value _ & Worksheets(n2).Range("D" & i2).Value & Worksheets(n2).Range("E" & i2).Value & Worksheets(n2).Range("F" & i2).Value _ & Worksheets(n2).Range("G" & i2).Value & Worksheets(n2).Range("H" & i2).Value & Worksheets(n2).Range("I" & i2).Value _ & Worksheets(n2).Range("J" & i2).Value & Worksheets(n2).Range("K" & i2).Value & Worksheets(n2).Range("L" & i2).Value _ & Worksheets(n2).Range("M" & i2).Value & Worksheets(n2).Range("N" & i2).Value & Worksheets(n2).Range("O" & i2).Value _ & Worksheets(n2).Range("P" & i2).Value & Worksheets(n2).Range("Q" & i2).Value & Worksheets(n2).Range("R" & i2).Value _ & Worksheets(n2).Range("S" & i2).Value & Worksheets(n2).Range("T" & i2).Value If Dupe < "" And Dupe = Dupe2 Then Worksheets(n).Range(DCol & i).Value = Worksheets(n).Range(DCol & i).Value + 1 Next cell2 nx: Next n2 Next cell End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count number of occurences in a list | Excel Worksheet Functions | |||
how to count the number of occurences of a letter ? | Excel Discussion (Misc queries) | |||
Creating number formula to count number occurences in a data set | Excel Programming | |||
How to count number of occurences of two different things at once? | Excel Worksheet Functions | |||
count number of occurences within a string | Excel Worksheet Functions |