Hi all, just found this site, and all I can say from looking thru some of the threads so far is "WOW"
This site's going to be an invaluable source of informatino for me, and hopefully as I progress, I can help out too
On to my question...our system generates some pretty ugly inventory reports by vendor and I thought I'd make a simple formatting macro to run on them...it works like a dream, but I'm wondering now...I have 4 columns of aged inventory amounts, and would like to add to the macro some code to total those individual columns so I can see aging totals at a glance. The problem is...one vendors' report may have only 50-60 rows (SKUs) and another vendor could have hundreds. Is there a way to add to the macro to have the total appear in those columns after the last row, even though it's different for every report, or am I wishing too much?
If this can't be done easily, it's not a big issue, since I guess I've already cut 15-20 mins of work down to 3-4 seconds with the macro - wouldn't kill me to total 4 more columns manually LOL
Thanks, and I've attached my macro below in case it helps (if we're not supposed to attach our macro code, accept my apologies)?
This site's going to be an invaluable source of informatino for me, and hopefully as I progress, I can help out too
On to my question...our system generates some pretty ugly inventory reports by vendor and I thought I'd make a simple formatting macro to run on them...it works like a dream, but I'm wondering now...I have 4 columns of aged inventory amounts, and would like to add to the macro some code to total those individual columns so I can see aging totals at a glance. The problem is...one vendors' report may have only 50-60 rows (SKUs) and another vendor could have hundreds. Is there a way to add to the macro to have the total appear in those columns after the last row, even though it's different for every report, or am I wishing too much?
If this can't be done easily, it's not a big issue, since I guess I've already cut 15-20 mins of work down to 3-4 seconds with the macro - wouldn't kill me to total 4 more columns manually LOL
Thanks, and I've attached my macro below in case it helps (if we're not supposed to attach our macro code, accept my apologies)?
Sub B291_CleanUp()
'
' B291_CleanUp Macro
' Macro recorded 1/24/2005 by Kevin Rowe
'
' Keyboard Shortcut: Ctrl+Shift+C
'
Columns("A:D").Select
Selection.Delete Shift:=xlToLeft
Range("E4:H4").Select
ActiveCell.FormulaR1C1 = "Days in Inventory"
Range("E4:H4").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Range("I6").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
Range("M4").Select
ActiveCell.FormulaR1C1 = "Historical Run Rates"
Range("M4:P4").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 8
Range("R5").Select
ActiveCell.FormulaR1C1 = "Guelph"
Range("S5").Select
ActiveCell.FormulaR1C1 = "Vancouver"
Range("R4").Select
ActiveCell.FormulaR1C1 = "Warehouse Location"
Range("R4:S4").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
ActiveWindow.LargeScroll ToRight:=-1
Rows("4:5").Select
Selection.Font.Bold = True
Cells.Select
Cells.EntireColumn.AutoFit
Range("A2").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
ActiveCell.FormulaR1C1 = "EMJ Confidential Inventory Report for:"
Range("A2").Select
Selection.Font.Bold = True
Rows("5:5").Select
Selection.Font.Underline = xlUnderlineStyleSingle
Range("A3").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Font.Italic = True
Selection.Font.Bold = True
Range("A3").Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "EMJ Confidential"
.RightHeader = ""
.LeftFooter = "Prepared by Kevin Rowe &D"
.CenterFooter = ""
.RightFooter = "Page &P of &N"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintPreview
End Sub