Guest User

Untitled

a guest
Feb 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. Sub Instructions_Received()
  2. ' Macro recorded 09/03/2011 by Paul Kamminga
  3.  
  4. Cells.Copy
  5. Workbooks("Macro.xls").Activate
  6.  
  7. Sheets.Add
  8. ActiveSheet.Paste
  9.  
  10. Sheets("Sheet1").Move
  11. ActiveSheet.Name = Range("B3")
  12.  
  13. Range("J:L").Delete Shift:=xlToLeft
  14. Range("H:H").Delete Shift:=xlToLeft
  15.  
  16. Range("D1").Select
  17. Range(Selection, Selection.End(xlDown)).Select
  18. Selection.NumberFormat = "#,##0"
  19.  
  20. Selection.Insert Shift:=xlToRight
  21. Selection = "=VLOOKUP(RC[-1],'C:\Documents and Settings\cm139\Desktop\[account list.xls]Sheet1'!C1:C10,10,FALSE)"
  22. Selection.Copy
  23. Selection.PasteSpecial Paste:=xlPasteValues
  24.  
  25. Selection.Insert Shift:=xlToRight
  26. Selection = "=VLOOKUP(RC[-1],'C:\Documents and Settings\cm139\Desktop\[account list.xls]Sheet1'!C1:C10,8,FALSE)"
  27. Selection.Copy
  28. Selection.PasteSpecial Paste:=xlPasteValues
  29.  
  30. Selection.Insert Shift:=xlToRight
  31. Selection = "=VLOOKUP(RC[-1],'C:\Documents and Settings\cm139\Desktop\[account list.xls]Sheet1'!C1:C10,4,FALSE)"
  32. Selection.Copy
  33. Selection.PasteSpecial Paste:=xlPasteValues
  34.  
  35. ActiveSheet.UsedRange.Borders.LineStyle = xlContinuous
  36. ActiveSheet.UsedRange.Borders(xlInsideVertical).Weight = xlHairline
  37. ActiveSheet.UsedRange.Borders(xlInsideHorizontal).Weight = xlHairline
  38.  
  39. Cells.EntireColumn.VerticalAlignment = xlCenter
  40. Range("D:E,L:L").HorizontalAlignment = xlLeft
  41. Columns("L:L").NumberFormat = "0"
  42.  
  43. Range("D1") = "Account"
  44. Range("D2") = "Name"
  45. Range("E1") = "Country"
  46. Range("F1") = "BIC"
  47. Range("F2") = "Address"
  48.  
  49. Selection.End(xlDown).Offset(1, -1).Select
  50. Selection = "Total"
  51. With Selection
  52. .HorizontalAlignment = xlCenter
  53. .Font.Bold = True
  54. End With
  55.  
  56. Selection.Offset(0, 4).Select
  57. Selection = "=SUM(R3C:R[-1]C)"
  58. With Selection
  59. .HorizontalAlignment = xlGeneral
  60. .Font.Bold = True
  61. .RowHeight = 15
  62. End With
  63.  
  64. Range(Selection.Offset(0, -5), Selection.Offset(0, 5)).Select
  65. Selection.Borders(xlEdgeTop).Weight = xlThin
  66. Selection.Borders(xlEdgeBottom).Weight = xlThin
  67. Selection.Borders(xlInsideVertical).LineStyle = xlNone
  68.  
  69. Range(Selection.Offset(1, 0), Selection.Offset(10, 0)).Select
  70. Selection.EntireRow.Delete
  71.  
  72. Selection.Borders(xlEdgeLeft).LineStyle = xlNone
  73. Selection.Borders(xlEdgeRight).LineStyle = xlNone
  74. Selection.Borders(xlEdgeBottom).LineStyle = xlNone
  75. Selection.Borders(xlInsideVertical).LineStyle = xlNone
  76. Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  77.  
  78. Range("G3:I3").Select
  79. Range(Selection, Selection.End(xlDown)).NumberFormat = "#,##0"
  80.  
  81. Rows("3:3").Select
  82. ActiveWindow.FreezePanes = True
  83.  
  84. Range("A1:L2").Select
  85. Selection.HorizontalAlignment = xlCenter
  86. Selection.Borders(xlEdgeBottom).Weight = xlThin
  87. Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  88.  
  89. Cells.EntireColumn.AutoFit
  90. Range("A2").ColumnWidth = 10.5
  91. Range("E2").ClearContents
  92.  
  93. With ActiveSheet.PageSetup
  94. .PrintTitleRows = "$1:$2"
  95. .CenterHeader = "&16&A"
  96. .RightFooter = "Page &P / &N"
  97. .LeftMargin = Application.InchesToPoints(0)
  98. .RightMargin = Application.InchesToPoints(0)
  99. .TopMargin = Application.InchesToPoints(0.8)
  100. .BottomMargin = Application.InchesToPoints(0.6)
  101. .HeaderMargin = Application.InchesToPoints(0.5)
  102. .FooterMargin = Application.InchesToPoints(0.3)
  103. .CenterHorizontally = True
  104. .Orientation = xlLandscape
  105. .PaperSize = xlPaperA4
  106. .Zoom = False
  107. .FitToPagesWide = 1
  108. .FitToPagesTall = 5
  109. End With
  110.  
  111. Workbooks("Macro.xls").Close SaveChanges:=False
  112. End Sub
Add Comment
Please, Sign In to add comment