example.abs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. '===================ABV PROJECT======================
  2. '===================MODULE 1 =======================
  3. Sub main ()
  4. 'you can edit this macro to execute any command when loading this workbook
  5. 'next line call the routine that fill the sheet
  6. call absmain ()
  7. End Sub
  8. 'Function not used if run inside abs (replaced by a builtin function)
  9. Sub absnc(row,col,formula)
  10. Cells(row,col).Formula=formula
  11. End sub
  12. Sub absmain()
  13. 'Do not edit this macro, changes will not be saved with the workbook!!!
  14. Dim objchart As Object
  15. Dim objbutton As Object
  16. Worksheets(1).Name = "TEST"
  17. Worksheets(2).Name = "B"
  18. Worksheets(3).Name = "C"
  19. Worksheets(1).Activate
  20. Columns("A").ColumnWidth = 1.857143
  21. Columns("B").ColumnWidth = 25.285714
  22. Columns("D").ColumnWidth = 5.714286
  23. Columns("E").ColumnWidth = 5.714286
  24. Columns("F").ColumnWidth = 5.714286
  25. Columns("G").ColumnWidth = 5.714286
  26. Columns("H").ColumnWidth = 5.714286
  27. Columns("I").ColumnWidth = 5.714286
  28. Columns("J").ColumnWidth = 6.857143
  29. Columns("K").ColumnWidth = 5.714286
  30. Columns("L").ColumnWidth = 5.714286
  31. Columns("M").ColumnWidth = 5.714286
  32. Columns("N").ColumnWidth = 6.857143
  33. Columns("O").ColumnWidth = 6.857143
  34. Columns("P").ColumnWidth = 5.714286
  35. Rows("2").RowHeight = 46
  36. Rows("3").RowHeight = 29
  37. absnc(2,2,"'Welcome !")
  38. Cells(2,2).Font.Name = "Times"
  39. Cells(2,2).Font.Size = 24
  40. Cells(2,2).Font.Bold = True
  41. Cells(2,2).HorizontalAlignment = xlCenter
  42. Cells(2,2).Font.ColorIndex = 14
  43. Cells(3,2).Font.Name = "Times"
  44. Cells(3,2).Font.Size = 24
  45. Cells(3,2).Font.Bold = True
  46. Cells(3,2).HorizontalAlignment = xlCenter
  47. absnc(5,2,"'Function:")
  48. Cells(5,2).Font.Name = "Courier"
  49. Cells(5,2).Font.Size = 14
  50. Cells(5,2).Font.Bold = True
  51. Cells(5,2).Font.Italic = True
  52. Cells(5,2).Font.ColorIndex = 20
  53. absnc(5,3,"'x =")
  54. Cells(5,3).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  55. Cells(5,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
  56. Cells(5,3).Font.Bold = True
  57. Cells(5,3).Interior.ColorIndex = 27
  58. Cells(5,3).Font.ColorIndex = 9
  59. absnc(5,4,"0")
  60. Cells(5,4).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  61. Cells(5,4).Interior.ColorIndex = 27
  62. Cells(5,4).Font.ColorIndex = 17
  63. Cells(5,4).NumberFormat = "0.00"
  64. absnc(5,5,"=+3.14/6+D5")
  65. Cells(5,5).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  66. Cells(5,5).Interior.ColorIndex = 27
  67. Cells(5,5).Font.ColorIndex = 17
  68. Cells(5,5).NumberFormat = "0.00"
  69. absnc(5,6,"=+3.14/6+E5")
  70. Cells(5,6).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  71. Cells(5,6).Interior.ColorIndex = 27
  72. Cells(5,6).Font.ColorIndex = 17
  73. Cells(5,6).NumberFormat = "0.00"
  74. absnc(5,7,"=+3.14/6+F5")
  75. Cells(5,7).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  76. Cells(5,7).Interior.ColorIndex = 27
  77. Cells(5,7).Font.ColorIndex = 17
  78. Cells(5,7).NumberFormat = "0.00"
  79. absnc(5,8,"=+3.14/6+G5")
  80. Cells(5,8).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  81. Cells(5,8).Interior.ColorIndex = 27
  82. Cells(5,8).Font.ColorIndex = 17
  83. Cells(5,8).NumberFormat = "0.00"
  84. absnc(5,9,"=+3.14/6+H5")
  85. Cells(5,9).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  86. Cells(5,9).Interior.ColorIndex = 27
  87. Cells(5,9).Font.ColorIndex = 17
  88. Cells(5,9).NumberFormat = "0.00"
  89. absnc(5,10,"=+3.14/6+I5")
  90. Cells(5,10).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  91. Cells(5,10).Interior.ColorIndex = 27
  92. Cells(5,10).Font.ColorIndex = 17
  93. Cells(5,10).NumberFormat = "0.00"
  94. absnc(5,11,"=+3.14/6+J5")
  95. Cells(5,11).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  96. Cells(5,11).Interior.ColorIndex = 27
  97. Cells(5,11).Font.ColorIndex = 17
  98. Cells(5,11).NumberFormat = "0.00"
  99. absnc(5,12,"=+3.14/6+K5")
  100. Cells(5,12).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  101. Cells(5,12).Interior.ColorIndex = 27
  102. Cells(5,12).Font.ColorIndex = 17
  103. Cells(5,12).NumberFormat = "0.00"
  104. absnc(5,13,"=+3.14/6+L5")
  105. Cells(5,13).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  106. Cells(5,13).Interior.ColorIndex = 27
  107. Cells(5,13).Font.ColorIndex = 17
  108. Cells(5,13).NumberFormat = "0.00"
  109. absnc(5,14,"=+3.14/6+M5")
  110. Cells(5,14).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  111. Cells(5,14).Interior.ColorIndex = 27
  112. Cells(5,14).Font.ColorIndex = 17
  113. Cells(5,14).NumberFormat = "0.00"
  114. absnc(5,15,"=+3.14/6+N5")
  115. Cells(5,15).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  116. Cells(5,15).Interior.ColorIndex = 27
  117. Cells(5,15).Font.ColorIndex = 17
  118. Cells(5,15).NumberFormat = "0.00"
  119. absnc(5,16,"=+3.14/6+O5")
  120. Cells(5,16).Borders(xlEdgeTop).LineStyle = xlLineStyleContinuous
  121. Cells(5,16).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
  122. Cells(5,16).Interior.ColorIndex = 27
  123. Cells(5,16).Font.ColorIndex = 17
  124. Cells(5,16).NumberFormat = "0.00"
  125. absnc(6,3,"'sin(x) =")
  126. Cells(6,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
  127. Cells(6,3).Font.Bold = True
  128. Cells(6,3).Interior.ColorIndex = 27
  129. Cells(6,3).Font.ColorIndex = 9
  130. absnc(6,4,"=+sin(D$5)")
  131. Cells(6,4).Interior.ColorIndex = 27
  132. Cells(6,4).Font.ColorIndex = 17
  133. Cells(6,4).NumberFormat = "0.00"
  134. absnc(6,5,"=+sin(E$5)")
  135. Cells(6,5).Interior.ColorIndex = 27
  136. Cells(6,5).Font.ColorIndex = 17
  137. Cells(6,5).NumberFormat = "0.00"
  138. absnc(6,6,"=+sin(F$5)")
  139. Cells(6,6).Interior.ColorIndex = 27
  140. Cells(6,6).Font.ColorIndex = 17
  141. Cells(6,6).NumberFormat = "0.00"
  142. absnc(6,7,"=+sin(G$5)")
  143. Cells(6,7).Interior.ColorIndex = 27
  144. Cells(6,7).Font.ColorIndex = 17
  145. Cells(6,7).NumberFormat = "0.00"
  146. absnc(6,8,"=+sin(H$5)")
  147. Cells(6,8).Interior.ColorIndex = 27
  148. Cells(6,8).Font.ColorIndex = 17
  149. Cells(6,8).NumberFormat = "0.00"
  150. absnc(6,9,"=+sin(I$5)")
  151. Cells(6,9).Interior.ColorIndex = 27
  152. Cells(6,9).Font.ColorIndex = 17
  153. Cells(6,9).NumberFormat = "0.00"
  154. absnc(6,10,"=+sin(J$5)")
  155. Cells(6,10).Interior.ColorIndex = 27
  156. Cells(6,10).Font.ColorIndex = 17
  157. Cells(6,10).NumberFormat = "0.00"
  158. absnc(6,11,"=+sin(K$5)")
  159. Cells(6,11).Interior.ColorIndex = 27
  160. Cells(6,11).Font.ColorIndex = 17
  161. Cells(6,11).NumberFormat = "0.00"
  162. absnc(6,12,"=+sin(L$5)")
  163. Cells(6,12).Interior.ColorIndex = 27
  164. Cells(6,12).Font.ColorIndex = 17
  165. Cells(6,12).NumberFormat = "0.00"
  166. absnc(6,13,"=+sin(M$5)")
  167. Cells(6,13).Interior.ColorIndex = 27
  168. Cells(6,13).Font.ColorIndex = 17
  169. Cells(6,13).NumberFormat = "0.00"
  170. absnc(6,14,"=+sin(N$5)")
  171. Cells(6,14).Interior.ColorIndex = 27
  172. Cells(6,14).Font.ColorIndex = 17
  173. Cells(6,14).NumberFormat = "0.00"
  174. absnc(6,15,"=+sin(O$5)")
  175. Cells(6,15).Interior.ColorIndex = 27
  176. Cells(6,15).Font.ColorIndex = 17
  177. Cells(6,15).NumberFormat = "0.00"
  178. absnc(6,16,"=+sin(P$5)")
  179. Cells(6,16).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
  180. Cells(6,16).Interior.ColorIndex = 27
  181. Cells(6,16).Font.ColorIndex = 17
  182. Cells(6,16).NumberFormat = "0.00"
  183. absnc(7,3,"'cos(x) =")
  184. Cells(7,3).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  185. Cells(7,3).Borders(xlEdgeLeft).LineStyle = xlLineStyleContinuous
  186. Cells(7,3).Font.Bold = True
  187. Cells(7,3).Interior.ColorIndex = 27
  188. Cells(7,3).Font.ColorIndex = 9
  189. absnc(7,4,"=+cos(D$5)")
  190. Cells(7,4).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  191. Cells(7,4).Interior.ColorIndex = 27
  192. Cells(7,4).Font.ColorIndex = 17
  193. Cells(7,4).NumberFormat = "0.00"
  194. absnc(7,5,"=+cos(E$5)")
  195. Cells(7,5).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  196. Cells(7,5).Interior.ColorIndex = 27
  197. Cells(7,5).Font.ColorIndex = 17
  198. Cells(7,5).NumberFormat = "0.00"
  199. absnc(7,6,"=+cos(F$5)")
  200. Cells(7,6).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  201. Cells(7,6).Interior.ColorIndex = 27
  202. Cells(7,6).Font.ColorIndex = 17
  203. Cells(7,6).NumberFormat = "0.00"
  204. absnc(7,7,"=+cos(G$5)")
  205. Cells(7,7).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  206. Cells(7,7).Interior.ColorIndex = 27
  207. Cells(7,7).Font.ColorIndex = 17
  208. Cells(7,7).NumberFormat = "0.00"
  209. absnc(7,8,"=+cos(H$5)")
  210. Cells(7,8).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  211. Cells(7,8).Interior.ColorIndex = 27
  212. Cells(7,8).Font.ColorIndex = 17
  213. Cells(7,8).NumberFormat = "0.00"
  214. absnc(7,9,"=+cos(I$5)")
  215. Cells(7,9).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  216. Cells(7,9).Interior.ColorIndex = 27
  217. Cells(7,9).Font.ColorIndex = 17
  218. Cells(7,9).NumberFormat = "0.00"
  219. absnc(7,10,"=+cos(J$5)")
  220. Cells(7,10).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  221. Cells(7,10).Interior.ColorIndex = 27
  222. Cells(7,10).Font.ColorIndex = 17
  223. Cells(7,10).NumberFormat = "0.00"
  224. absnc(7,11,"=+cos(K$5)")
  225. Cells(7,11).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  226. Cells(7,11).Interior.ColorIndex = 27
  227. Cells(7,11).Font.ColorIndex = 17
  228. Cells(7,11).NumberFormat = "0.00"
  229. absnc(7,12,"=+cos(L$5)")
  230. Cells(7,12).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  231. Cells(7,12).Interior.ColorIndex = 27
  232. Cells(7,12).Font.ColorIndex = 17
  233. Cells(7,12).NumberFormat = "0.00"
  234. absnc(7,13,"=+cos(M$5)")
  235. Cells(7,13).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  236. Cells(7,13).Interior.ColorIndex = 27
  237. Cells(7,13).Font.ColorIndex = 17
  238. Cells(7,13).NumberFormat = "0.00"
  239. absnc(7,14,"=+cos(N$5)")
  240. Cells(7,14).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  241. Cells(7,14).Interior.ColorIndex = 27
  242. Cells(7,14).Font.ColorIndex = 17
  243. Cells(7,14).NumberFormat = "0.00"
  244. absnc(7,15,"=+cos(O$5)")
  245. Cells(7,15).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  246. Cells(7,15).Interior.ColorIndex = 27
  247. Cells(7,15).Font.ColorIndex = 17
  248. Cells(7,15).NumberFormat = "0.00"
  249. absnc(7,16,"=+cos(P$5)")
  250. Cells(7,16).Borders(xlEdgeBottom).LineStyle = xlLineStyleContinuous
  251. Cells(7,16).Borders(xlEdgeRight).LineStyle = xlLineStyleContinuous
  252. Cells(7,16).Interior.ColorIndex = 27
  253. Cells(7,16).Font.ColorIndex = 17
  254. Cells(7,16).NumberFormat = "0.00"
  255. absnc(10,2,"'chart examples:")
  256. Cells(10,2).Font.Name = "Courier"
  257. Cells(10,2).Font.Size = 14
  258. Cells(10,2).Font.Bold = True
  259. Cells(10,2).Font.Italic = True
  260. Cells(10,2).Font.ColorIndex = 20
  261. Cells(13,2).Font.Name = "Courier"
  262. Cells(13,2).Font.Size = 14
  263. Cells(13,2).Font.Bold = True
  264. Cells(13,2).Font.Italic = True
  265. Cells(13,2).Font.ColorIndex = 20
  266. Set objchart = Worksheets("TEST").ChartObjects.Add(211,200,522,263)
  267. objchart.Activate
  268. ActiveChart.ChartType = xlLine
  269. ActiveChart.SeriesCollection.NewSeries
  270. ActiveChart.SeriesCollection(1).XValues = Range("D5:P5")
  271. ActiveChart.SeriesCollection(1).Name = "'sin (x)"
  272. ActiveChart.SeriesCollection(1).Values = Range("D6:P6")
  273. ActiveChart.SeriesCollection.NewSeries
  274. ActiveChart.SeriesCollection(2).Name = "'cos (x)"
  275. ActiveChart.SeriesCollection(2).Values = Range("D7:P7")
  276. ActiveChart.HasTitle = True
  277. ActiveChart.ChartTitle.Text = "'title"
  278. ActiveChart.Axes(xlCategory).HasTitle = True
  279. ActiveChart.Axes(xlCategory).AxisTitle.Text = "'X axis"
  280. ActiveChart.Axes(xlValue).HasMajorGridlines = True
  281. ActiveChart.Axes(xlValue ).HasTitle = True
  282. ActiveChart.Axes(xlValue ).AxisTitle.Text = "'Y axis"
  283. ActiveChart.Axes(xlCategory ).MaximumScale = 6.140000
  284. ActiveChart.Axes(xlCategory ).MajorUnit = 1.570000
  285. ActiveSheet.Shapes.AddShape(msoShapeOval,20, 15,169,72).Select
  286. Worksheets(2).Activate
  287. Worksheets(3).Activate
  288. Worksheets(1).Activate
  289. End Sub