SZTM_Spielliste.bas 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. Attribute VB_Name = "Module2"
  2. Sub SZTM_Spielliste()
  3. Attribute SZTM_Spielliste.VB_Description = "Formatiert die Spielliste"
  4. Attribute SZTM_Spielliste.VB_ProcData.VB_Invoke_Func = "X\n14"
  5. '
  6. ' SZTM_Spielliste Macro
  7. ' Formatiert die Spielliste
  8. '
  9. ' Keyboard Shortcut: Ctrl+Shift+X
  10. '
  11. Dim ws As Worksheet
  12. For Each ws In ActiveWorkbook.Sheets
  13. With ws
  14. ws.Activate
  15. 'Select first row, change font size, make bold and merge
  16. Range("A1:K1").Select
  17. With Selection
  18. .HorizontalAlignment = xlLeft
  19. .VerticalAlignment = xlBottom
  20. .WrapText = False
  21. .Orientation = 0
  22. .AddIndent = False
  23. .IndentLevel = 0
  24. .ShrinkToFit = False
  25. .ReadingOrder = xlContext
  26. .MergeCells = True
  27. End With
  28. Selection.Merge
  29. With Selection.Font
  30. .Name = "Calibri"
  31. .Size = 14
  32. .Strikethrough = False
  33. .Superscript = False
  34. .Subscript = False
  35. .OutlineFont = False
  36. .Shadow = False
  37. .Underline = xlUnderlineStyleNone
  38. .ThemeColor = xlThemeColorLight1
  39. .TintAndShade = 0
  40. .ThemeFont = xlThemeFontMinor
  41. End With
  42. Selection.Font.Bold = True
  43. 'Select second row, make bold and merge
  44. Range("A2:K2").Select
  45. With Selection
  46. .HorizontalAlignment = xlLeft
  47. .VerticalAlignment = xlBottom
  48. .WrapText = False
  49. .Orientation = 0
  50. .AddIndent = False
  51. .IndentLevel = 0
  52. .ShrinkToFit = False
  53. .ReadingOrder = xlContext
  54. .MergeCells = True
  55. End With
  56. Selection.Merge
  57. Selection.Font.Bold = True
  58. 'Select all data cells, activate grid, fit width, increase height and add header.
  59. Range("A4:K4").Select
  60. With Selection.Interior
  61. .Pattern = xlSolid
  62. .PatternColorIndex = xlAutomatic
  63. .ThemeColor = xlThemeColorDark1
  64. .TintAndShade = -0.149998474074526
  65. .PatternTintAndShade = 0
  66. End With
  67. Selection.Font.Bold = True
  68. ActiveWindow.SmallScroll Down:=-3
  69. Range("A4").Select
  70. Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
  71. Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  72. Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  73. With Selection.Borders(xlEdgeLeft)
  74. .LineStyle = xlContinuous
  75. .ColorIndex = 0
  76. .TintAndShade = 0
  77. .Weight = xlThin
  78. End With
  79. With Selection.Borders(xlEdgeTop)
  80. .LineStyle = xlContinuous
  81. .ColorIndex = 0
  82. .TintAndShade = 0
  83. .Weight = xlThin
  84. End With
  85. With Selection.Borders(xlEdgeBottom)
  86. .LineStyle = xlContinuous
  87. .ColorIndex = 0
  88. .TintAndShade = 0
  89. .Weight = xlThin
  90. End With
  91. With Selection.Borders(xlEdgeRight)
  92. .LineStyle = xlContinuous
  93. .ColorIndex = 0
  94. .TintAndShade = 0
  95. .Weight = xlThin
  96. End With
  97. With Selection.Borders(xlInsideVertical)
  98. .LineStyle = xlContinuous
  99. .ColorIndex = 0
  100. .TintAndShade = 0
  101. .Weight = xlThin
  102. End With
  103. With Selection.Borders(xlInsideHorizontal)
  104. .LineStyle = xlContinuous
  105. .ColorIndex = 0
  106. .TintAndShade = 0
  107. .Weight = xlThin
  108. End With
  109. Selection.RowHeight = 33.75
  110. Selection.EntireColumn.AutoFit
  111. 'Columns("A:A").EntireColumn.AutoFit
  112. 'Columns("B:B").EntireColumn.AutoFit
  113. 'Columns("C:C").EntireColumn.AutoFit
  114. 'Columns("D:D").EntireColumn.AutoFit
  115. 'Columns("E:E").EntireColumn.AutoFit
  116. End With
  117. Next
  118. End Sub