Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have abt 220 rows and 25 columns to fill up with this function and i tested the speed abt 0.0625 sec which means it takes up to 5.5min to run finish the whole thing Anyway to make it faster ? i have a table consist of 5 impt fields (PO#,PartNo,POQty,DueDate,POBalQty) My Function call in 2 values(PartNo and EDate) EDate = a Monday I need to display whether during the week i have - how many dely Or - how many POQty Or - how many dely and POBal Anyway to make it faster ? Function calQty(PartNo As String, EDate) Dim PO, Bal, Dely, POtemp, Baltemp, Delytemp Worksheets("PO").Activate NextRow = Application.WorksheetFunction.CountA(Worksheets("P O").Range("A:A")) PO = 0 Bal = 0 Dely = 0 POtemp = 0 Baltemp = 0 Delytemp = 0 For A = 1 To NextRow If Worksheets("PO").Cells(A, 3) = PartNo And Worksheets("PO").Cells(A, 6) < EDate + 7 And Worksheets("PO").Cells(A, 6) = EDate Then x = A If Worksheets("PO").Cells(x, 10) = 0 Then Delytemp = Worksheets("PO").Cells(x, 5) Dely = Dely + Delytemp ElseIf Worksheets("PO").Cells(x, 10) = Worksheets("PO").Cells(x, 5) Then POtemp = Worksheets("PO").Cells(x, 5) PO = PO + POtemp Else Baltemp = Worksheets("PO").Cells(x, 10) Bal = Bal + Baltemp End If End If Next A Bal = Bal + PO If Bal = 0 Then calQty = "D " & Dely ElseIf Dely = 0 Then calQty = PO Else calQty = "D " & Dely & " B " & Bal End If If Bal = 0 And Dely = 0 Then calQty = 0 End If End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom View show is very slow | Excel Discussion (Misc queries) | |||
how do i show a zero in front of a number ie 0625 in excel | Excel Discussion (Misc queries) | |||
Slow Excel Navigation with Up / Down Arrow and slow scrolling | Excel Discussion (Misc queries) | |||
Adding custom list and text boxes to the custom tool bar from Excel C API | Excel Discussion (Misc queries) | |||
Can you link a custom property to an Excel custom header text? | Setting up and Configuration of Excel |