Trai60

ProlificCSVMacro2.bas

May 17th, 2024 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. Attribute VB_Name = "Prolific02"
  2. Sub Results()
  3. Attribute Results.VB_ProcData.VB_Invoke_Func = " \n14"
  4. '
  5. ' Results Macro
  6. '
  7.  
  8. '
  9. Range("A1").Select
  10. ActiveCell.FormulaR1C1 = "Results"
  11. Range("A3").Select
  12. ActiveCell.FormulaR1C1 = "Approved"
  13. Range("A4").Select
  14. ActiveCell.FormulaR1C1 = "Returned"
  15. Range("A5").Select
  16. ActiveCell.FormulaR1C1 = "Awaiting Review"
  17. Range("A6").Select
  18. ActiveCell.FormulaR1C1 = "Rejected"
  19. Range("A8").Select
  20. ActiveCell.FormulaR1C1 = "Approval Rating"
  21. Range("A10").Select
  22. ActiveCell.FormulaR1C1 = "Time Worked"
  23. Range("A12").Select
  24. ActiveCell.FormulaR1C1 = "Reward £"
  25. Range("A13").Select
  26. ActiveCell.FormulaR1C1 = "Bonus £"
  27. Range("A14").Select
  28. ActiveCell.FormulaR1C1 = "Reward $"
  29. Range("A15").Select
  30. ActiveCell.FormulaR1C1 = "Bonus $"
  31. Range("A17").Select
  32. ActiveCell.FormulaR1C1 = "Total £"
  33. Range("A18").Select
  34. ActiveCell.FormulaR1C1 = "Total $ Converted to £"
  35. Range("A20").Select
  36. ActiveCell.FormulaR1C1 = "Total Earned"
  37. Range("A22").Select
  38. ActiveCell.FormulaR1C1 = "P/H Rate"
  39. Range("B3").Select
  40. ActiveCell.FormulaR1C1 = _
  41. "=COUNTIF(my_prolific_submission_history!C[8], ""APPROVED"")"
  42. Range("B4").Select
  43. ActiveCell.FormulaR1C1 = _
  44. "=COUNTIF(my_prolific_submission_history!C[8], ""RETURNED"")"
  45. Range("B5").Select
  46. ActiveCell.FormulaR1C1 = _
  47. "=COUNTIF(my_prolific_submission_history!C[8], ""AWAITING REVIEW"")"
  48. Range("B6").Select
  49. ActiveCell.FormulaR1C1 = _
  50. "=COUNTIF(my_prolific_submission_history!C[8], ""REJECTED"")"
  51. Range("B8").Select
  52. ActiveCell.FormulaR1C1 = "=TEXT(R[-5]C / (R[-5]C + R[-2]C), ""0.00%"")"
  53. Range("B10").Select
  54. ActiveCell.FormulaR1C1 = "=SUM(my_prolific_submission_history[Time Taken])"
  55. Range("B12").Select
  56. ActiveCell.FormulaR1C1 = _
  57. "=ROUND(SUMIFS(my_prolific_submission_history!C, my_prolific_submission_history!C[8], ""<>RETURNED"", my_prolific_submission_history!C[8], ""<>REJECTED"", my_prolific_submission_history!C[8], ""<>AWAITING REVIEW""), 2)"
  58. Range("B13").Select
  59. ActiveCell.FormulaR1C1 = "=SUM(my_prolific_submission_history[Bonus £])"
  60. Range("B14").Select
  61. ActiveCell.FormulaR1C1 = _
  62. "=ROUND(SUMIFS(my_prolific_submission_history!C[2], my_prolific_submission_history!C[8], ""<>RETURNED"", my_prolific_submission_history!C[8], ""<>REJECTED"", my_prolific_submission_history!C[8], ""<>AWAITING REVIEW""), 2)"
  63. Range("B15").Select
  64. ActiveCell.FormulaR1C1 = "=SUM(my_prolific_submission_history[Bonus $])"
  65. Range("B17").Select
  66. ActiveCell.FormulaR1C1 = "=SUM(R[-5]C,R[-4]C)"
  67. Range("B20").Select
  68. ActiveCell.FormulaR1C1 = "=SUM(R[-6]C+R[-5]C)*0.789041"
  69. Cells.Select
  70. Selection.Columns.AutoFit
  71. Range("B10").Select
  72. Selection.NumberFormat = "[h]:mm:ss"
  73. Range("B12").Select
  74. Selection.NumberFormat = _
  75. "_-[$£-en-GB]* #,##0.00_-;-[$£-en-GB]* #,##0.00_-;_-[$£-en-GB]* ""-""??_-;_-@_-"
  76. Range("B13").Select
  77. Selection.NumberFormat = _
  78. "_-[$£-en-GB]* #,##0.00_-;-[$£-en-GB]* #,##0.00_-;_-[$£-en-GB]* ""-""??_-;_-@_-"
  79. Range("B14").Select
  80. Selection.NumberFormat = _
  81. "_-[$$-en-US]* #,##0.00_ ;_-[$$-en-US]* -#,##0.00 ;_-[$$-en-US]* ""-""??_ ;_-@_ "
  82. Range("B15").Select
  83. Selection.NumberFormat = _
  84. "_-[$$-en-US]* #,##0.00_ ;_-[$$-en-US]* -#,##0.00 ;_-[$$-en-US]* ""-""??_ ;_-@_ "
  85. Range("B17").Select
  86. Selection.NumberFormat = _
  87. "_-[$£-en-GB]* #,##0.00_-;-[$£-en-GB]* #,##0.00_-;_-[$£-en-GB]* ""-""??_-;_-@_-"
  88. Range("B18").Select
  89. ActiveCell.FormulaR1C1 = "=SUM(R[-4]C+R[-3]C)*0.789041"
  90. Range("B18").Select
  91. Selection.NumberFormat = _
  92. "_-[$£-en-GB]* #,##0.00_-;-[$£-en-GB]* #,##0.00_-;_-[$£-en-GB]* ""-""??_-;_-@_-"
  93. Range("B20").Select
  94. Selection.FormulaR1C1 = ""
  95. Range("B20").Select
  96. Application.CutCopyMode = False
  97. ActiveCell.FormulaR1C1 = "=SUM(R[-3]C,R[-2]C)"
  98. Range("B20").Select
  99. Selection.NumberFormat = _
  100. "_-[$£-en-GB]* #,##0.00_-;-[$£-en-GB]* #,##0.00_-;_-[$£-en-GB]* ""-""??_-;_-@_-"
  101. Range("B22").Select
  102. ActiveCell.FormulaR1C1 = "=R[-2]C / (R[-12]C * 24)"
  103. Range("B22").Select
  104. Selection.NumberFormat = _
  105. "_-[$£-en-GB]* #,##0.00_-;-[$£-en-GB]* #,##0.00_-;_-[$£-en-GB]* ""-""??_-;_-@_-"
  106. Range("B8").Select
  107. With Selection
  108. .HorizontalAlignment = xlRight
  109. .VerticalAlignment = xlBottom
  110. .WrapText = False
  111. .Orientation = 0
  112. .AddIndent = False
  113. .IndentLevel = 0
  114. .ShrinkToFit = False
  115. .ReadingOrder = xlContext
  116. .MergeCells = False
  117. End With
  118. Range("B24").Select
  119. End Sub
  120.  
Advertisement
Add Comment
Please, Sign In to add comment