Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Instructions_Received()
- ' Macro recorded 09/03/2011 by Paul Kamminga
- Cells.Copy
- Workbooks("Macro.xls").Activate
- Sheets.Add
- ActiveSheet.Paste
- Sheets("Sheet1").Move
- ActiveSheet.Name = Range("B3")
- Range("J:L").Delete Shift:=xlToLeft
- Range("H:H").Delete Shift:=xlToLeft
- Range("D1").Select
- Range(Selection, Selection.End(xlDown)).Select
- Selection.NumberFormat = "#,##0"
- Selection.Insert Shift:=xlToRight
- Selection = "=VLOOKUP(RC[-1],'C:\Documents and Settings\cm139\Desktop\[account list.xls]Sheet1'!C1:C10,10,FALSE)"
- Selection.Copy
- Selection.PasteSpecial Paste:=xlPasteValues
- Selection.Insert Shift:=xlToRight
- Selection = "=VLOOKUP(RC[-1],'C:\Documents and Settings\cm139\Desktop\[account list.xls]Sheet1'!C1:C10,8,FALSE)"
- Selection.Copy
- Selection.PasteSpecial Paste:=xlPasteValues
- Selection.Insert Shift:=xlToRight
- Selection = "=VLOOKUP(RC[-1],'C:\Documents and Settings\cm139\Desktop\[account list.xls]Sheet1'!C1:C10,4,FALSE)"
- Selection.Copy
- Selection.PasteSpecial Paste:=xlPasteValues
- ActiveSheet.UsedRange.Borders.LineStyle = xlContinuous
- ActiveSheet.UsedRange.Borders(xlInsideVertical).Weight = xlHairline
- ActiveSheet.UsedRange.Borders(xlInsideHorizontal).Weight = xlHairline
- Cells.EntireColumn.VerticalAlignment = xlCenter
- Range("D:E,L:L").HorizontalAlignment = xlLeft
- Columns("L:L").NumberFormat = "0"
- Range("D1") = "Account"
- Range("D2") = "Name"
- Range("E1") = "Country"
- Range("F1") = "BIC"
- Range("F2") = "Address"
- Selection.End(xlDown).Offset(1, -1).Select
- Selection = "Total"
- With Selection
- .HorizontalAlignment = xlCenter
- .Font.Bold = True
- End With
- Selection.Offset(0, 4).Select
- Selection = "=SUM(R3C:R[-1]C)"
- With Selection
- .HorizontalAlignment = xlGeneral
- .Font.Bold = True
- .RowHeight = 15
- End With
- Range(Selection.Offset(0, -5), Selection.Offset(0, 5)).Select
- Selection.Borders(xlEdgeTop).Weight = xlThin
- Selection.Borders(xlEdgeBottom).Weight = xlThin
- Selection.Borders(xlInsideVertical).LineStyle = xlNone
- Range(Selection.Offset(1, 0), Selection.Offset(10, 0)).Select
- Selection.EntireRow.Delete
- Selection.Borders(xlEdgeLeft).LineStyle = xlNone
- Selection.Borders(xlEdgeRight).LineStyle = xlNone
- Selection.Borders(xlEdgeBottom).LineStyle = xlNone
- Selection.Borders(xlInsideVertical).LineStyle = xlNone
- Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
- Range("G3:I3").Select
- Range(Selection, Selection.End(xlDown)).NumberFormat = "#,##0"
- Rows("3:3").Select
- ActiveWindow.FreezePanes = True
- Range("A1:L2").Select
- Selection.HorizontalAlignment = xlCenter
- Selection.Borders(xlEdgeBottom).Weight = xlThin
- Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
- Cells.EntireColumn.AutoFit
- Range("A2").ColumnWidth = 10.5
- Range("E2").ClearContents
- With ActiveSheet.PageSetup
- .PrintTitleRows = "$1:$2"
- .CenterHeader = "&16&A"
- .RightFooter = "Page &P / &N"
- .LeftMargin = Application.InchesToPoints(0)
- .RightMargin = Application.InchesToPoints(0)
- .TopMargin = Application.InchesToPoints(0.8)
- .BottomMargin = Application.InchesToPoints(0.6)
- .HeaderMargin = Application.InchesToPoints(0.5)
- .FooterMargin = Application.InchesToPoints(0.3)
- .CenterHorizontally = True
- .Orientation = xlLandscape
- .PaperSize = xlPaperA4
- .Zoom = False
- .FitToPagesWide = 1
- .FitToPagesTall = 5
- End With
- Workbooks("Macro.xls").Close SaveChanges:=False
- End Sub
Add Comment
Please, Sign In to add comment