Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.99 KB | None | 0 0
  1. Private Sub CommandButton5_Click()
  2. Cells.Replace What:="A01-", Replacement:=" ", LookAt:=xlPart, _
  3. SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
  4. ReplaceFormat:=True
  5. End Sub
  6.  
  7. Private Sub UserForm_Click()
  8.  
  9. End Sub
  10.  
  11. Private Sub CommandButton1_Click()
  12. Range("A1:Y50506").Select
  13. Selection.Copy
  14. Sheets.Add After:=ActiveSheet
  15. Sheets("Foglio2").Select
  16. Sheets("Foglio2").Name = "Script"
  17. ActiveSheet.Paste
  18. End Sub
  19.  
  20. Private Sub CommandButton2_Click()
  21. Range("B6:B372").Select
  22. ActiveWorkbook.Worksheets("Script").Sort.SortFields.Clear
  23. ActiveWorkbook.Worksheets("Script").Sort.SortFields.Add Key:=Range("B6:B372") _
  24. , SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:= _
  25. "A01,A02,A03,A04,A05,A06,A07,A08,A09,A10,A11,A12,A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,A23,A24,A25,A26,A27,A28,A29,A30,A31,A32,A33,A34,A35,A36,A37,A38,A39,A40,A41,A42,A43,A44,A45,A46,A47,A48,A49,A50,A51,A52,A53,A54,A55,A56,A57,A58,A59,A60,A61,A62,A63,A64" _
  26. , DataOption:=xlSortNormal
  27. With ActiveWorkbook.Worksheets("Script").Sort
  28. .SetRange Range("B6:B372")
  29. .Header = xlGuess
  30. .MatchCase = False
  31. .Orientation = xlTopToBottom
  32. .SortMethod = xlPinYin
  33. .Apply
  34. End With
  35. ActiveWindow.SmallScroll Down:=-12
  36. End Sub
  37.  
  38.  
  39. Private Sub CommandButton3_Click()
  40. AggA10
  41. End Sub
  42.  
  43. Private Sub AggA10()
  44. Dim i, ii As Long
  45. Dim S As String
  46. S = "A0"
  47. Dim na, ng, nd, nh, ne, nf As Integer
  48. na = 1
  49. For i = 1 To 5000 Step 1
  50. If Cells(i, "B").Value Like "*A0" & na & "*" Then
  51. Cells(i, "B").EntireRow.Insert
  52. Cells(i, "B").Value = "A0" & na
  53. na = na + 1
  54. End If
  55.  
  56. Next
  57. AggA100
  58. End Sub
  59.  
  60. Private Sub AggA100()
  61. Dim i, ii As Long
  62. Dim S As String
  63. Dim na, ng, nd, nh, ne, nf As Integer
  64. na = 10
  65. For i = 1 To 5000 Step 1
  66. If Cells(i, "B").Value Like "*A" & na & "*" Then
  67. Cells(i, "B").EntireRow.Insert
  68. Cells(i, "B").Value = "A" & na
  69. na = na + 1
  70. End If
  71.  
  72. Next
  73. AggA09
  74. End Sub
  75.  
  76. Private Sub AggA09()
  77. Dim i, ii As Long
  78. Dim S As String
  79. Dim na, ng, nd, nh, ne, nf As Integer
  80. na = 10
  81. For i = 1 To 5000 Step 1
  82. If Cells(i, "B").Value Like "A09*" Then
  83. Cells(i, "B").EntireRow.Insert
  84. Cells(i, "B").Value = "A09"
  85. Exit For
  86. End If
  87.  
  88. Next
  89. AggD10
  90. End Sub
  91.  
  92. Private Sub AggD10()
  93. Dim i, ii As Long
  94. Dim S As String
  95. S = "A0"
  96. Dim na, ng, nd, nh, ne, nf As Integer
  97. na = 1
  98. For i = 1 To 5000 Step 1
  99. If Cells(i, "B").Value Like "*D0" & na & "*" Then
  100. Cells(i, "B").EntireRow.Insert
  101. Cells(i, "B").Value = "D0" & na
  102. na = na + 1
  103. End If
  104.  
  105. Next
  106. AggG10
  107. End Sub
  108.  
  109. Private Sub AggG10()
  110. Dim i, ii As Long
  111. Dim S As String
  112. S = "A0"
  113. Dim na, ng, nd, nh, ne, nf As Integer
  114. na = 1
  115. For i = 1 To 5000 Step 1
  116. If Cells(i, "B").Value Like "*G0" & na & "*" Then
  117. Cells(i, "B").EntireRow.Insert
  118. Cells(i, "B").Value = "G0" & na
  119. na = na + 1
  120. End If
  121.  
  122. Next
  123. AggE10
  124. End Sub
  125.  
  126. Private Sub AggE10()
  127. Dim i, ii As Long
  128. Dim S As String
  129. S = "A0"
  130. Dim na, ng, nd, nh, ne, nf As Integer
  131. na = 1
  132. For i = 1 To 5000 Step 1
  133. If Cells(i, "B").Value Like "*E0" & na & "*" Then
  134. Cells(i, "B").EntireRow.Insert
  135. Cells(i, "B").Value = "E0" & na
  136. na = na + 1
  137. End If
  138.  
  139. Next
  140. AggH10
  141. End Sub
  142.  
  143. Private Sub AggH10()
  144. Dim i, ii As Long
  145. Dim S As String
  146. S = "A0"
  147. Dim na, ng, nd, nh, ne, nf As Integer
  148. na = 1
  149. For i = 1 To 5000 Step 1
  150. If Cells(i, "B").Value Like "*H0" & na & "*" Then
  151. Cells(i, "B").EntireRow.Insert
  152. Cells(i, "B").Value = "H0" & na
  153. na = na + 1
  154. End If
  155.  
  156. Next
  157. AggF10
  158. End Sub
  159.  
  160. Private Sub AggF10()
  161. Dim i, ii As Long
  162. Dim S As String
  163. S = "A0"
  164. Dim na, ng, nd, nh, ne, nf As Integer
  165. na = 1
  166. For i = 1 To 5000 Step 1
  167. If Cells(i, "B").Value Like "*F0" & na & "*" Then
  168. Cells(i, "B").EntireRow.Insert
  169. Cells(i, "B").Value = "F0" & na
  170. na = na + 1
  171. End If
  172.  
  173. Next
  174. AggG100
  175. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement