Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Option Explicit
  2.  
  3. Sub CreateUniqueList()
  4.  
  5. Dim lastrow As Long
  6.  
  7. ActiveSheet.Name = "Raw Data"
  8.  
  9. Dim ws As Worksheet
  10. Set ws = Sheets("Raw Data")
  11.  
  12. Dim Champs As Worksheet
  13. Set Champs = ActiveWorkbook.Sheets.Add(After:= _
  14. ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count))
  15. Champs.Name = "Unique Champions"
  16.  
  17. ws.Activate
  18.  
  19. lastrow = Cells(Rows.Count, "D").End(xlUp).Row
  20.  
  21. ActiveSheet.Range("D6:D" & lastrow).AdvancedFilter _
  22. Action:=xlFilterCopy, _
  23. CopyToRange:=Champs.Range("A1"), _
  24. Unique:=True
  25.  
  26. Dim Champ1 As String
  27. Dim Champ2 As String
  28. Dim Champ3 As String
  29. Dim Champ4 As String
  30. Dim Champ5 As String
  31. Dim Champ6 As String
  32. Dim Champ7 As String
  33. Dim Champ8 As String
  34. Dim Champ9 As String
  35. Dim Champ10 As String
  36. Dim Champ11 As String
  37. Dim Champ12 As String
  38. Dim Champ13 As String
  39. Dim Champ14 As String
  40. Dim Champ15 As String
  41.  
  42. Champs.Activate
  43.  
  44. Champ1 = Cells(2, 1).Value
  45. Champ2 = Cells(3, 1).Value
  46. Champ3 = Cells(4, 1).Value
  47. Champ4 = Cells(5, 1).Value
  48. Champ5 = Cells(6, 1).Value
  49. Champ6 = Cells(7, 1).Value
  50. Champ7 = Cells(8, 1).Value
  51. Champ8 = Cells(9, 1).Value
  52. Champ9 = Cells(10, 1).Value
  53. Champ10 = Cells(11, 1).Value
  54. Champ11 = Cells(12, 1).Value
  55. Champ12 = Cells(13, 1).Value
  56. Champ13 = Cells(14, 1).Value
  57. Champ14 = Cells(15, 1).Value
  58. Champ15 = Cells(16, 1).Value
  59.  
  60. End Sub
  61.  
  62. lastrow = Cells(Rows.Count, "D").End(xlUp).Row
  63.  
  64. ActiveSheet.Range("D6:D" & lastrow).AdvancedFilter _
  65. Action:=xlFilterCopy, _
  66. CopyToRange:=Champs.Range("A1"), _
  67. Unique:=True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement