PaulF
Active Member
Hello all,
VBA rookie here:
This sub work as needed:
I want it to run when the this sheet is changed:
^^ Crashes Excel...
VBA rookie here:
This sub work as needed:
Code:
Sub GetUniquePP1CatList()
Dim D As Object, C As Variant, i As Long, lr As String
Set D = CreateObject("Scripting.Dictionary")
Sheets("Pay Period 1").Select
' Vendor Release Summary UNIQUE LIST
lr = "L" & Range("C6").End(xlDown).Row + 1
C = Range("C6:" & lr)
For i = 1 To UBound(C, 1)
D(C(i, 1)) = 1
Next i
Sheets("Pay Period 1").Range("I6:I100").ClearContents
Sheets("Pay Period 1").Range("I6").Resize(D.Count) = Application.Transpose(D.Keys)
End Sub
I want it to run when the this sheet is changed:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim D As Object, C As Variant, i As Long, lr As String
Set D = CreateObject("Scripting.Dictionary")
Sheets("Pay Period 1").Select
' Vendor Release Summary UNIQUE LIST
lr = "L" & Range("C6").End(xlDown).Row + 1
C = Range("C6:" & lr)
For i = 1 To UBound(C, 1)
D(C(i, 1)) = 1
Next i
Worksheets("Pay Period 1").Range("I6:I100").ClearContents
Worksheets("Pay Period 1").Range("I6").Resize(D.Count) = Application.Transpose(D.Keys)
End Sub
^^ Crashes Excel...