Advertisement
Guest User

Untitled

a guest
Oct 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Månedsrapport()
  2. '
  3. ' Månedsrapport Makro
  4. ' Makro for omsetningsrapport butikk
  5. '
  6.  
  7. '
  8.    Sheets.Add After:=ActiveSheet
  9.     Range("B2:L3").Select
  10.     Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  11.     Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  12.     With Selection.Borders(xlEdgeLeft)
  13.         .LineStyle = xlContinuous
  14.         .ColorIndex = 0
  15.         .TintAndShade = 0
  16.         .Weight = xlThin
  17.     End With
  18.     With Selection.Borders(xlEdgeTop)
  19.         .LineStyle = xlContinuous
  20.         .ColorIndex = 0
  21.         .TintAndShade = 0
  22.         .Weight = xlThin
  23.     End With
  24.     With Selection.Borders(xlEdgeBottom)
  25.         .LineStyle = xlContinuous
  26.         .ColorIndex = 0
  27.         .TintAndShade = 0
  28.         .Weight = xlThin
  29.     End With
  30.     With Selection.Borders(xlEdgeRight)
  31.         .LineStyle = xlContinuous
  32.         .ColorIndex = 0
  33.         .TintAndShade = 0
  34.         .Weight = xlThin
  35.     End With
  36.     With Selection.Borders(xlInsideVertical)
  37.         .LineStyle = xlContinuous
  38.         .ColorIndex = 0
  39.         .TintAndShade = 0
  40.         .Weight = xlThin
  41.     End With
  42.     With Selection.Borders(xlInsideHorizontal)
  43.         .LineStyle = xlContinuous
  44.         .ColorIndex = 0
  45.         .TintAndShade = 0
  46.         .Weight = xlThin
  47.     End With
  48.     Range("B2").Select
  49.     ActiveCell.FormulaR1C1 = "Omsetning totalt"
  50.     Range("C2").Select
  51.     ActiveCell.FormulaR1C1 = "Omsetning nettsalg"
  52.     Range("D2").Select
  53.     ActiveCell.FormulaR1C1 = "Omsetning butikk"
  54.     Range("E2").Select
  55.     ActiveCell.FormulaR1C1 = "% butikk"
  56.     Range("F2").Select
  57.     ActiveCell.FormulaR1C1 = "DB totalt"
  58.     Range("G2").Select
  59.     ActiveCell.FormulaR1C1 = "DB nettsalg"
  60.     Range("H2").Select
  61.     ActiveCell.FormulaR1C1 = "DB butikk"
  62.     Range("I2").Select
  63.     ActiveCell.FormulaR1C1 = "% butikk"
  64.     Range("J2").Select
  65.     ActiveCell.FormulaR1C1 = "DG(%) totalt"
  66.     Range("K2").Select
  67.     ActiveCell.FormulaR1C1 = "DG(%) nettsalg"
  68.     Range("L2").Select
  69.     ActiveCell.FormulaR1C1 = "DG(%) butikk"
  70.     Range("B3").Select
  71.     Range("B3").Formula = "=SUM(Multicase!C[17])"
  72.     Selection.Style = "Currency"
  73.     Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
  74.     Range("C3").Select
  75.     ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[5],""<>Butikk"",Multicase!C[16])"
  76.     Selection.Style = "Currency"
  77.     Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
  78.     Range("D3").Select
  79.     ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[4],""Butikk"",Multicase!C[15])"
  80.     Selection.Style = "Currency"
  81.     Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
  82.     Range("E3").Select
  83.     Range("E3").Formula = "=D3/B3"
  84.     Selection.Style = "Percent"
  85.     Selection.NumberFormat = "0.0 %"
  86.     Range("F3").Select
  87.     Range("F3").Formula = "=SUM(Multicase!C[19])"
  88.     Selection.Style = "Currency"
  89.     Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
  90.     Range("G3").Select
  91.     ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[1],""<>Butikk"",Multicase!C[18])"
  92.     Selection.Style = "Currency"
  93.     Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
  94.     Range("H3").Select
  95.     ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[0],""Butikk"",Multicase!C[17])"
  96.     Selection.Style = "Currency"
  97.     Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
  98.     Range("I3").Select
  99.     Range("I3").Formula = "=H3/F3"
  100.     Selection.Style = "Percent"
  101.     Selection.NumberFormat = "0.0 %"
  102.     Range("J3").Select
  103.     Range("J3").Formula = "=F3/B3"
  104.     Selection.Style = "Percent"
  105.     Selection.NumberFormat = "0.0 %"
  106.     Range("K3").Select
  107.     Range("K3").Formula = "=G3/C3"
  108.     Selection.Style = "Percent"
  109.     Selection.NumberFormat = "0.0 %"
  110.     Range("L3").Select
  111.     Range("L3").Formula = "=H3/D3"
  112.     Selection.Style = "Percent"
  113.     Selection.NumberFormat = "0.0 %"
  114. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement