FormatHelper.vba 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. Sub HeaderBlue()
  2. With Selection.Interior
  3. .Pattern = xlSolid
  4. .PatternColorIndex = xlAutomatic
  5. .ThemeColor = xlThemeColorLight2
  6. .TintAndShade = 0.799981688894314
  7. .PatternTintAndShade = 0
  8. End With
  9. Call FormatHeaderFont
  10. Call FormatBorders
  11. End Sub
  12. Sub HeaderGrey()
  13. With Selection.Interior
  14. .Pattern = xlSolid
  15. .PatternColorIndex = xlAutomatic
  16. .ThemeColor = xlThemeColorDark1
  17. .TintAndShade = -0.149998474074526
  18. .PatternTintAndShade = 0
  19. End With
  20. Call FormatHeaderFont
  21. Call FormatBorders
  22. End Sub
  23. Private Sub FormatHeaderFont()
  24. With Selection.Font
  25. .Color = RGB(0, 0, 0)
  26. .Bold = True
  27. .Name = "Arial"
  28. .Size = "8"
  29. End With
  30. End Sub
  31. Private Sub FormatBorders()
  32. ' Border Diagonal
  33. Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  34. Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  35. ' Border Left
  36. With Selection.Borders(xlEdgeLeft)
  37. .LineStyle = xlContinuous
  38. .ColorIndex = xlAutomatic
  39. .TintAndShade = 0
  40. .Weight = xlThin
  41. End With
  42. 'Border Right
  43. With Selection.Borders(xlEdgeRight)
  44. .LineStyle = xlContinuous
  45. .ColorIndex = xlAutomatic
  46. .TintAndShade = 0
  47. .Weight = xlThin
  48. End With
  49. 'Border Inside
  50. With Selection.Borders(xlInsideVertical)
  51. .LineStyle = xlContinuous
  52. .ColorIndex = xlAutomatic
  53. .TintAndShade = 0
  54. .Weight = xlThin
  55. End With
  56. 'Border Top
  57. With Selection.Borders(xlEdgeTop)
  58. .LineStyle = xlContinuous
  59. .ColorIndex = xlAutomatic
  60. .TintAndShade = 0
  61. .Weight = xlMedium
  62. End With
  63. 'Border Bottom
  64. With Selection.Borders(xlEdgeBottom)
  65. .LineStyle = xlContinuous
  66. .ColorIndex = xlAutomatic
  67. .TintAndShade = 0
  68. .Weight = xlThin
  69. End With
  70. End Sub