Guest User

Untitled

a guest
Oct 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1. Sub Auto_Open()
  2. '
  3. ' Macro2 Macro
  4. '
  5.  
  6. '
  7. Application.PrintCommunication = False
  8. With ActiveSheet.PageSetup
  9. .PrintTitleRows = "$1:$1"
  10. .LeftMargin = Application.InchesToPoints(0.17)
  11. .RightMargin = Application.InchesToPoints(0.17)
  12. .TopMargin = Application.InchesToPoints(0.62)
  13. .BottomMargin = Application.InchesToPoints(0.48)
  14. .HeaderMargin = Application.InchesToPoints(0.17)
  15. .FooterMargin = Application.InchesToPoints(0.17)
  16. .PrintHeadings = False
  17. .PrintGridlines = False
  18. .PrintComments = xlPrintNoComments
  19. .PrintQuality = 1200
  20. .CenterHorizontally = True
  21. .CenterVertically = False
  22. .Orientation = xlLandscape
  23. .Draft = False
  24. .PaperSize = xlPaperLegal
  25. .FirstPageNumber = xlAutomatic
  26. .Order = xlDownThenOver
  27. .BlackAndWhite = False
  28. .Zoom = 60
  29. .PrintErrors = xlPrintErrorsDisplayed
  30. .OddAndEvenPagesHeaderFooter = False
  31. .DifferentFirstPageHeaderFooter = False
  32. .ScaleWithDocHeaderFooter = True
  33. .AlignMarginsHeaderFooter = True
  34. End With
  35. Application.PrintCommunication = True
  36. With Selection
  37. .HorizontalAlignment = xlGeneral
  38. .VerticalAlignment = xlBottom
  39. .WrapText = True
  40. .Orientation = 0
  41. .AddIndent = False
  42. .IndentLevel = 0
  43. .ShrinkToFit = False
  44. .ReadingOrder = xlContext
  45. .MergeCells = False
  46. End With
  47. With Selection
  48. .HorizontalAlignment = xlCenter
  49. .VerticalAlignment = xlBottom
  50. .WrapText = True
  51. .Orientation = 0
  52. .AddIndent = False
  53. .IndentLevel = 0
  54. .ShrinkToFit = False
  55. .ReadingOrder = xlContext
  56. .MergeCells = False
  57. End With
  58. With Selection
  59. .HorizontalAlignment = xlCenter
  60. .VerticalAlignment = xlCenter
  61. .WrapText = True
  62. .Orientation = 0
  63. .AddIndent = False
  64. .IndentLevel = 0
  65. .ShrinkToFit = False
  66. .ReadingOrder = xlContext
  67. .MergeCells = False
  68. End With
  69. Range("N2:O2").Select
  70. Range(Selection, Selection.End(xlDown)).Select
  71. Range(Selection, Selection.End(xlDown)).Select
  72. With Selection
  73. .HorizontalAlignment = xlGeneral
  74. .VerticalAlignment = xlBottom
  75. .WrapText = True
  76. .Orientation = 0
  77. .AddIndent = False
  78. .IndentLevel = 0
  79. .ShrinkToFit = False
  80. .ReadingOrder = xlContext
  81. .MergeCells = False
  82. End With
  83. With Selection
  84. .HorizontalAlignment = xlLeft
  85. .VerticalAlignment = xlBottom
  86. .WrapText = True
  87. .Orientation = 0
  88. .AddIndent = False
  89. .IndentLevel = 0
  90. .ShrinkToFit = False
  91. .ReadingOrder = xlContext
  92. .MergeCells = False
  93. End With
  94. With Selection
  95. .HorizontalAlignment = xlLeft
  96. .VerticalAlignment = xlTop
  97. .WrapText = True
  98. .Orientation = 0
  99. .AddIndent = False
  100. .IndentLevel = 0
  101. .ShrinkToFit = False
  102. .ReadingOrder = xlContext
  103. .MergeCells = False
  104. End With
  105. Range("A1").Select
  106. Range(Selection, Selection.End(xlToRight)).Select
  107. With Selection.Interior
  108. .Pattern = xlSolid
  109. .PatternColorIndex = xlAutomatic
  110. .ThemeColor = xlThemeColorLight2
  111. .TintAndShade = 0.599993896298105
  112. .PatternTintAndShade = 0
  113. End With
  114. Range("A1").Select
  115. Range(Selection, Selection.End(xlToRight)).Select
  116. With Selection
  117. .HorizontalAlignment = xlCenter
  118. .VerticalAlignment = xlCenter
  119. .WrapText = True
  120. .Orientation = 0
  121. .AddIndent = False
  122. .IndentLevel = 0
  123. .ShrinkToFit = False
  124. .ReadingOrder = xlContext
  125. .MergeCells = False
  126. End With
  127. Range("L1").Select
  128. Columns("B:B").ColumnWidth = 10.86
  129. Columns("D:D").ColumnWidth = 18.86
  130. Columns("E:E").ColumnWidth = 13.43
  131. Columns("F:F").ColumnWidth = 11.29
  132. Columns("F:F").ColumnWidth = 19.29
  133. Columns("G:G").EntireColumn.AutoFit
  134. Range("H1").Select
  135. ActiveWindow.SmallScroll Down:=-33
  136. Range("I1").Select
  137. Range("G1").Select
  138. Columns("H:H").ColumnWidth = 13
  139. Columns("I:I").ColumnWidth = 18.71
  140. Columns("J:J").ColumnWidth = 19.86
  141. Columns("K:K").ColumnWidth = 13.57
  142. Columns("L:L").ColumnWidth = 11
  143. Columns("L:L").ColumnWidth = 11.43
  144. Columns("M:M").ColumnWidth = 12.71
  145. Columns("M:M").ColumnWidth = 15.86
  146. Columns("N:N").ColumnWidth = 41.86
  147. Columns("O:O").ColumnWidth = 18.57
  148. Columns("O:O").ColumnWidth = 28.86
  149. Columns("O:O").ColumnWidth = 42
  150. Columns("L:L").ColumnWidth = 12.71
  151. Range("K2:L2").Select
  152. Range(Selection, Selection.End(xlDown)).Select
  153. Range(Selection, Selection.End(xlDown)).Select
  154. Selection.NumberFormat = "$#,##0"
  155. ActiveWindow.SmallScroll Down:=-30
  156. Columns("A:A").Select
  157. Selection.EntireColumn.Hidden = True
  158. Rows("1:1000").EntireRow.AutoFit
  159. Range("B1").Select
  160. Range(Selection, Selection.End(xlToRight)).Select
  161. Range(Selection, Selection.End(xlDown)).Select
  162. Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  163. Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  164. ActiveWindow.Zoom = 75
  165. With Selection.Borders(xlEdgeLeft)
  166. .LineStyle = xlContinuous
  167. .ColorIndex = 0
  168. .TintAndShade = 0
  169. .Weight = xlThin
  170. End With
  171. With Selection.Borders(xlEdgeTop)
  172. .LineStyle = xlContinuous
  173. .ColorIndex = 0
  174. .TintAndShade = 0
  175. .Weight = xlThin
  176. End With
  177. With Selection.Borders(xlEdgeBottom)
  178. .LineStyle = xlContinuous
  179. .ColorIndex = 0
  180. .TintAndShade = 0
  181. .Weight = xlThin
  182. End With
  183. With Selection.Borders(xlEdgeRight)
  184. .LineStyle = xlContinuous
  185. .ColorIndex = 0
  186. .TintAndShade = 0
  187. .Weight = xlThin
  188. End With
  189. With Selection.Borders(xlInsideVertical)
  190. .LineStyle = xlContinuous
  191. .ColorIndex = 0
  192. .TintAndShade = 0
  193. .Weight = xlThin
  194. End With
  195. With Selection.Borders(xlInsideHorizontal)
  196. .LineStyle = xlContinuous
  197. .ColorIndex = 0
  198. .TintAndShade = 0
  199. .Weight = xlThin
  200. End With
  201. Range("E2").Select
  202. ActiveWindow.SmallScroll Down:=-6
  203. ActiveWindow.LargeScroll ToRight:=-1
  204. With ActiveWindow
  205. .SplitColumn = 0
  206. .SplitRow = 1
  207. End With
  208. ActiveWindow.FreezePanes = True
  209. With ActiveSheet.PageSetup
  210. .LeftHeader = ""
  211. .CenterHeader = "&""-,Bold""&12Weekly Staffing Summary Request &D"
  212. .RightHeader = ""
  213. .LeftFooter = "&D"
  214. .CenterFooter = "&P"
  215. .RightFooter = "&F"
  216. End With
  217.  
  218. End Sub
  219.  
  220. On Error Resume Next
  221.  
  222. On Error Resume Next
  223. Application.PrintCommunication = False
  224. Err.Clear
  225.  
  226. On Error Resume Next
  227. Application.PrintCommunication = True
  228. Err.Clear
Add Comment
Please, Sign In to add comment