Code Not working

ravaz

Board Regular
Joined
Mar 25, 2008
Messages
196
The dictionary items are not showing

Code:
Sub Tracker()Dim a, w(), i As Long, ii As Long, n As Long, z As String, ws As Worksheet, dic As Object
Sheets("Tracker").Range("a6: b100000 ").ClearContents


Set dic = CreateObject("Scripting.Dictionary")
dic.CompareMode = vbTextCompare


For Each ws In Worksheets
    If ws.Name = "Collections Tracker" Or ws.Name = "Collections Tracker Musty" Then
        a = Sheets(ws.Name).Range("a6").CurrentRegion.Resize(, 3).Value
            
                For i = 6 To UBound(a, 1)
                        z = a(i, 2)
                        If Not dic.exists(z) Then
                            ReDim w(2 To 3)
                            For ii = 2 To 3: w(ii) = a(i, ii): Next
                            dic.Add z, b
                        End If
                Next
    End If
Next ws




Sheets("Tracker").Range("a6").Resize(dic.Count, 2).Value = Application.Transpose(Application.Transpose(dic.items))
Sheets("Tracker").Range("a5:b100000").Sort Key1:=Range("b5"), Header:=xlYes, Order1:=xlAscending


End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Your dictionary items:- "b", has not been declared and has no apparent values !!.
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top