I have a starting point (thanks to Fluff for some time ago providing me the code shown below... but this code is executed in a different way plus it isn't looking within only visible cells, which is what I need this to do...)
so what I'm needing it to do is to have the code look in column "E" starting at row 21 and going down (looking in visible cells only) to the last cell found containing an entry (any entry, but it will always be a string no values):
So that the result in the target cells (column N and O starting at row 2) looks like this:
this is what I currently have (which doesn't work):
Thanks for any help or suggestions that can allow me accomplish what I am trying to do
so what I'm needing it to do is to have the code look in column "E" starting at row 21 and going down (looking in visible cells only) to the last cell found containing an entry (any entry, but it will always be a string no values):
So that the result in the target cells (column N and O starting at row 2) looks like this:
this is what I currently have (which doesn't work):
VBA Code:
Dim Cl As Variant
Dim Va As Variant
Dim Obj As Object
ActiveWorkbook.Worksheets("REPORTS").Activate
Set Obj = CreateObject("scripting.dictionary")
For Each Cl In Worksheets("REPORTS").Range("E21", Worksheets("REPORTS").Range("E" & Rows.Count).End(xlUp))
If Not Obj.Exists(Cl.value) Then
Obj.Add Cl.value, 1
Else
Obj.Item(Cl.value) = Obj.Item(Cl.value) + 1
End If
Next Cl
For Each Va In Obj.Keys
Worksheets("REPORTS").Range("O" & Rows.Count).End(xlUp).Offset(1).Resize(, 2).value = Array(Va, Obj(Va))
Next Va
ActiveWindow.SmallScroll Down:=-48
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("REPORTS").Range(Cells(2, 15), Cells(17, 15)).Select
ActiveWorkbook.Worksheets("REPORTS").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("REPORTS").Sort.SortFields.Add Key:=Range("O" & Rows.Count).End(xlUp), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("REPORTS").Sort
.SetRange Range(Cells(2, 15), Cells(17, 15))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Thanks for any help or suggestions that can allow me accomplish what I am trying to do