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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Your dictionary items:- "b", has not been declared and has no apparent values !!.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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