include print setup for price list build. filter out -0- for plcore upload

This commit is contained in:
Paul Trowbridge 2022-05-12 13:41:12 -04:00
parent 22af739ffb
commit b96be55725

View File

@ -88,7 +88,7 @@ Sub test_full20()
'-------------------------dump contents------------------------------------------------------ '-------------------------dump contents------------------------------------------------------
Call x.SHTp_Dump(cms_pl, new_sh.Name, 1, 1, True, True) Call x.SHTp_Dump(cms_pl, new_sh.Name, 1, 1, True, True)
new_sh.Select new_sh.Activate
ActiveSheet.Cells(1, 1).CurrentRegion.Select ActiveSheet.Cells(1, 1).CurrentRegion.Select
Selection.Columns.autofit Selection.Columns.autofit
@ -219,6 +219,8 @@ Sub price_load_plcore()
'-------identify the active sheet and load the contents to an array----------- '-------identify the active sheet and load the contents to an array-----------
load = unpivot_current_sheet(plist, pcol) load = unpivot_current_sheet(plist, pcol)
'-------filter out any -0- prices before loading
Call x.TBLp_FilterSingle(load, 8, "0.00", False)
'------if no columns are labeled plist then exit------------------------------ '------if no columns are labeled plist then exit------------------------------
@ -488,7 +490,6 @@ Function unpivot_current_sheet(ByRef lists() As String, ByRef pcol() As Long) As
End Function End Function
get_price
Sub build_pretty() Sub build_pretty()
@ -626,7 +627,7 @@ Sub build_pretty()
nws.Cells(5, 1).Select nws.Cells(5, 1).Select
Application.ScreenUpdating = True Application.ScreenUpdating = True
Call page_setup Call print_setup(nws, last)
'--------------------save file-------------------------------------------------------------------------------- '--------------------save file--------------------------------------------------------------------------------
'prettyfilepath = "C:\Users\PTrowbridge\Downloads\PriceListPackage\" & "U.AAA.DI" & "\" & "HC Companies Distributor Price List.xlsx" 'prettyfilepath = "C:\Users\PTrowbridge\Downloads\PriceListPackage\" & "U.AAA.DI" & "\" & "HC Companies Distributor Price List.xlsx"
@ -784,14 +785,21 @@ Sub print_setup(sheet As Worksheet, last_row As Long)
With sheet.PageSetup With sheet.PageSetup
.PrintArea = Sel.address .PrintArea = Sel.address
.PrintTitleRows = "$1:$5" .PrintTitleRows = "$1:$5"
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.Orientation = xlLandscape .Orientation = xlLandscape
.FitToPagesWide = 1 .FitToPagesWide = 1
'.FitToPagesTall = 0
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0.25)
.FooterMargin = Application.InchesToPoints(0.25)
End With End With
End Sub End Sub
Sub call_print()
Call print_setup(ActiveSheet, 960)
End Sub