From b96be55725a04c5e85a0b139c1fa06fa3ca62520 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 12 May 2022 13:41:12 -0400 Subject: [PATCH] include print setup for price list build. filter out -0- for plcore upload --- PriceLists.bas | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/PriceLists.bas b/PriceLists.bas index c80eb48..02be01c 100644 --- a/PriceLists.bas +++ b/PriceLists.bas @@ -88,7 +88,7 @@ Sub test_full20() '-------------------------dump contents------------------------------------------------------ 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 Selection.Columns.autofit @@ -219,6 +219,8 @@ Sub price_load_plcore() '-------identify the active sheet and load the contents to an array----------- 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------------------------------ @@ -488,7 +490,6 @@ Function unpivot_current_sheet(ByRef lists() As String, ByRef pcol() As Long) As End Function -get_price Sub build_pretty() @@ -626,7 +627,7 @@ Sub build_pretty() nws.Cells(5, 1).Select Application.ScreenUpdating = True - Call page_setup + Call print_setup(nws, last) '--------------------save file-------------------------------------------------------------------------------- '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 .PrintArea = Sel.address .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 .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 Sub + +Sub call_print() + + Call print_setup(ActiveSheet, 960) + +End Sub