Hi Guys need help. The below code runs fine on one laptop and gives an error on other. The error is on line "Sheets("List of List").Range("A2:A1000").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo"
Am not sure whats wrong. Am getting the following error:
Runtime error '-2147417848 (800100108)': Automation Error The object invoked has disconnected from its clients.
Am not sure whats wrong. Am getting the following error:
Runtime error '-2147417848 (800100108)': Automation Error The object invoked has disconnected from its clients.
Code:
With Sheets("Raw Data") lRow = .Columns("D:K").Find(What:="*", After:=Cells(1, 4), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, SearchFormat:=False).Row
Set rng = .Range("D7:K" & lRow)
Set Dic = CreateObject("Scripting.Dictionary")
For Each Dn In rng
If Dn.Value <> "" Then
Dic(Dn.Value) = ""
End If
Next
Sheets("List of List").Range("A2").Resize(Dic.Count) = Application.WorksheetFunction.Transpose(Dic.Keys)
Sheets("List of List").Range("A2:A1000").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
End With
With Sheets("Raw Data")
lRow = .Columns("D:K").Find(What:="*", After:=Cells(1, 4), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, SearchFormat:=False).Row
Set rng = .Range("D7:D" & lRow)
Set Dic = CreateObject("Scripting.Dictionary")
For Each Dn In rng
If Dn.Value <> "" Then
Dic(Dn.Value) = ""
End If
Next
Sheets("List of List").Range("B2").Resize(Dic.Count) = Application.WorksheetFunction.Transpose(Dic.Keys)
Sheets("List of List").Range("B2:B1000").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlNo
End With
With Sheets("Raw Data")
lRow = .Columns("D:K").Find(What:="*", After:=Cells(1, 4), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, SearchFormat:=False).Row
Set rng = .Range("E7:E" & lRow)
Set Dic = CreateObject("Scripting.Dictionary")
For Each Dn In rng
If Dn.Value <> "" Then
Dic(Dn.Value) = ""
End If
Next
Sheets("List of List").Range("C2").Resize(Dic.Count) = Application.WorksheetFunction.Transpose(Dic.Keys)
Sheets("List of List").Range("C2:C1000").Sort Key1:=Range("C1"), Order1:=xlAscending, Header:=xlNo
End With
End Sub
Last edited: