Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Månedsrapport()
- '
- ' Månedsrapport Makro
- ' Makro for omsetningsrapport butikk
- '
- '
- Sheets.Add After:=ActiveSheet
- Range("B2:L3").Select
- Selection.Borders(xlDiagonalDown).LineStyle = xlNone
- Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With Selection.Borders(xlEdgeLeft)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With Selection.Borders(xlEdgeTop)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With Selection.Borders(xlEdgeBottom)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With Selection.Borders(xlEdgeRight)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With Selection.Borders(xlInsideVertical)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- With Selection.Borders(xlInsideHorizontal)
- .LineStyle = xlContinuous
- .ColorIndex = 0
- .TintAndShade = 0
- .Weight = xlThin
- End With
- Range("B2").Select
- ActiveCell.FormulaR1C1 = "Omsetning totalt"
- Range("C2").Select
- ActiveCell.FormulaR1C1 = "Omsetning nettsalg"
- Range("D2").Select
- ActiveCell.FormulaR1C1 = "Omsetning butikk"
- Range("E2").Select
- ActiveCell.FormulaR1C1 = "% butikk"
- Range("F2").Select
- ActiveCell.FormulaR1C1 = "DB totalt"
- Range("G2").Select
- ActiveCell.FormulaR1C1 = "DB nettsalg"
- Range("H2").Select
- ActiveCell.FormulaR1C1 = "DB butikk"
- Range("I2").Select
- ActiveCell.FormulaR1C1 = "% butikk"
- Range("J2").Select
- ActiveCell.FormulaR1C1 = "DG(%) totalt"
- Range("K2").Select
- ActiveCell.FormulaR1C1 = "DG(%) nettsalg"
- Range("L2").Select
- ActiveCell.FormulaR1C1 = "DG(%) butikk"
- Range("B3").Select
- Range("B3").Formula = "=SUM(Multicase!C[17])"
- Selection.Style = "Currency"
- Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
- Range("C3").Select
- ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[5],""<>Butikk"",Multicase!C[16])"
- Selection.Style = "Currency"
- Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
- Range("D3").Select
- ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[4],""Butikk"",Multicase!C[15])"
- Selection.Style = "Currency"
- Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
- Range("E3").Select
- Range("E3").Formula = "=D3/B3"
- Selection.Style = "Percent"
- Selection.NumberFormat = "0.0 %"
- Range("F3").Select
- Range("F3").Formula = "=SUM(Multicase!C[19])"
- Selection.Style = "Currency"
- Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
- Range("G3").Select
- ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[1],""<>Butikk"",Multicase!C[18])"
- Selection.Style = "Currency"
- Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
- Range("H3").Select
- ActiveCell.FormulaR1C1 = "=SUMIF(Multicase!C[0],""Butikk"",Multicase!C[17])"
- Selection.Style = "Currency"
- Selection.NumberFormat = "_-$ * #,##0_-;-$ * #,##0_-;_-$ * ""-""??_-;_-@_-"
- Range("I3").Select
- Range("I3").Formula = "=H3/F3"
- Selection.Style = "Percent"
- Selection.NumberFormat = "0.0 %"
- Range("J3").Select
- Range("J3").Formula = "=F3/B3"
- Selection.Style = "Percent"
- Selection.NumberFormat = "0.0 %"
- Range("K3").Select
- Range("K3").Formula = "=G3/C3"
- Selection.Style = "Percent"
- Selection.NumberFormat = "0.0 %"
- Range("L3").Select
- Range("L3").Formula = "=H3/D3"
- Selection.Style = "Percent"
- Selection.NumberFormat = "0.0 %"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement