Advertisement
Robb1010

Excel Variance

May 11th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Variance()
  2. '
  3. ' Variance Macro
  4. '
  5.  
  6. '
  7.    ActiveSheet.Shapes.Range(Array("Picture -767")).Select
  8.     Selection.Delete
  9.     Cells.Select
  10.     Selection.UnMerge
  11.     Selection.RowHeight = 15
  12.     Selection.ColumnWidth = 12
  13.     Selection.Columns.AutoFit
  14.     Rows("1:23").Select
  15.     Selection.Delete Shift:=xlUp
  16.     Range("J1").Select
  17.     Selection.Cut
  18.     Range("K1").Select
  19.     ActiveSheet.Paste
  20.     ActiveWindow.ScrollColumn = 2
  21.     ActiveWindow.ScrollColumn = 3
  22.     ActiveWindow.ScrollColumn = 4
  23.     ActiveWindow.ScrollColumn = 5
  24.     ActiveWindow.ScrollColumn = 6
  25.     Range("Q1:S1").Select
  26.     Selection.Cut
  27.     Range("P1").Select
  28.     ActiveSheet.Paste
  29.     ActiveWindow.ScrollColumn = 7
  30.     ActiveWindow.ScrollColumn = 8
  31.     ActiveWindow.ScrollColumn = 9
  32.     Range("W1:Z1").Select
  33.     Selection.Cut
  34.     Range("U1").Select
  35.     ActiveSheet.Paste
  36.     Range("V8").Select
  37.     ActiveWindow.ScrollColumn = 8
  38.     ActiveWindow.ScrollColumn = 7
  39.     ActiveWindow.ScrollColumn = 6
  40.     ActiveWindow.ScrollColumn = 5
  41.     ActiveWindow.ScrollColumn = 3
  42.     ActiveWindow.ScrollColumn = 2
  43.     ActiveWindow.ScrollColumn = 1
  44.     Cells.Select
  45.     Selection.Columns.AutoFit
  46.     Range("A:A,C:C,D:D,F:J,M:M,Q:Q").Select
  47.     Range("Q1").Activate
  48.     Selection.Delete Shift:=xlToLeft
  49.     Range("I:J,L:M").Select
  50.     Range("L1").Activate
  51.     Selection.Delete Shift:=xlToLeft
  52.     Cells.Select
  53.     With Selection.Font
  54.         .Name = "Calibri"
  55.         .Size = 10
  56.         .Strikethrough = False
  57.         .Superscript = False
  58.         .Subscript = False
  59.         .OutlineFont = False
  60.         .Shadow = False
  61.         .Underline = xlUnderlineStyleNone
  62.         .TintAndShade = 0
  63.         .ThemeFont = xlThemeFontMinor
  64.     End With
  65.     With Selection.Font
  66.         .Name = "Calibri"
  67.         .Size = 11
  68.         .Strikethrough = False
  69.         .Superscript = False
  70.         .Subscript = False
  71.         .OutlineFont = False
  72.         .Shadow = False
  73.         .Underline = xlUnderlineStyleNone
  74.         .TintAndShade = 0
  75.         .ThemeFont = xlThemeFontMinor
  76.     End With
  77.     With Selection.Font
  78.         .ColorIndex = xlAutomatic
  79.         .TintAndShade = 0
  80.     End With
  81.     Selection.Borders(xlDiagonalDown).LineStyle = xlNone
  82.     Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  83.     Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  84.     Selection.Borders(xlEdgeTop).LineStyle = xlNone
  85.     Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  86.     Selection.Borders(xlEdgeRight).LineStyle = xlNone
  87.     Selection.Borders(xlInsideVertical).LineStyle = xlNone
  88.     Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  89.     Rows("2:2").Select
  90.     Selection.Delete Shift:=xlUp
  91.     Range("A1").Select
  92.     Range(Selection, Selection.End(xlDown)).Select
  93.     numRows = Selection.Rows.Count
  94.     Rows(numRows + 1 & ":" & numRows + 1).Select
  95.     Selection.Delete Shift:=xlUp
  96.     Range("K" & numRows + 4).Select
  97.     Selection.Delete Shift:=xlUp
  98.     Range("A1:J1,A" & numRows + 1 & ":J" & numRows + 1).Select
  99.     With Selection.Interior
  100.         .Pattern = xlSolid
  101.         .PatternColorIndex = xlAutomatic
  102.         .ThemeColor = xlThemeColorDark1
  103.         .TintAndShade = -0.249977111117893
  104.         .PatternTintAndShade = 0
  105.     End With
  106.     With Selection.Font
  107.         .ThemeColor = xlThemeColorLight1
  108.         .TintAndShade = 0
  109.     End With
  110.     Selection.Font.Bold = True
  111.     Range("F" & numRows + 1).Cut Range("E" & numRows + 1)
  112.     Range("A1:J" & numRows + 1).Select
  113.     Selection.Borders.LineStyle = xlContinuous
  114.     Range("A1:J" & numRows).Select
  115.     ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$J$" & numRows), , xlYes).Name = "Table1"
  116.     ActiveSheet.ListObjects("Table1").TableStyle = "TableStyleLight8"
  117.     Columns("C:H").Select
  118.     Selection.NumberFormat = "0.00"
  119.     Columns("F:F").Select
  120.     Selection.Delete
  121.     ActiveWindow.DisplayGridlines = True
  122.     Range("A2").Select
  123.    
  124. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement