Dim CalcQtyOnPage As Integer Dim PhysQtyOnPage As Integer Dim LackQtyOnPage As Integer Dim SurpQtyOnPage As Integer Dim Modulo As Integer Public Function CountQtyOnPage(ByVal Counter As Integer,Qty As Integer,Flag As String) if Counter < 16 then Modulo = Counter Mod 15 if Modulo = 0 then if Flag = "Calc" then CalcQtyOnPage = 0 elseif Flag = "Phys" then PhysQtyOnPage = 0 elseif Flag = "Lack" then LackQtyOnPage = 0 elseif Flag = "Surp" then SurpQtyOnPage = 0 end if end if else Counter > 15 then Counter = Counter - 15 Modulo = Counter Mod 19 if Modulo = 0 then if Flag = "Calc" then CalcQtyOnPage = 0 elseif Flag = "Phys" then PhysQtyOnPage = 0 elseif Flag = "Lack" then LackQtyOnPage = 0 elseif Flag = "Surp" then SurpQtyOnPage = 0 end if end if end if if Flag = "Calc" then CalcQtyOnPage = CalcQtyOnPage + Qty Return = CalcQtyOnPage elseif Flag = "Phys" then PhysQtyOnPage = PhysQtyOnPage + Qty Return = PhysQtyOnPage elseif Flag = "Lack" then LackQtyOnPage = LackQtyOnPage + Qty Return = LackQtyOnPage elseif Flag = "Surp" then SurpQtyOnPage = SurpQtyOnPage + Qty Return = SurpQtyOnPage end if End Function
Answers
It works as expected... More or Less...
It looks like we need to be able to solve everything from Windows, to SQL, and VBA.
It seems
It works as expected... More or Less...
P.s. I have mistake in code, now it`s ok :roll: