CCkfm2000
07-04-2007, 06:46 AM
Many thanks for looking at this problem
I need to speed this vba code.
Original thread http://www.vbaexpress.com/forum/showthread.php?t=9583
Thanks again
Option Explicit
Dim InvenA As Integer
Dim InvenB As Integer
Dim InvenC As Integer
Sub Inventory()
Do
InventoryABC
lookupInvenoryinfo
Do While InvenA = InvenB
InventoryABC
lookupInvenoryinfo
Exit Do
Loop
Loop Until InvenA = InvenB
End Sub
Sub lookupInvenoryinfo()
Sheets("LANE QUANTITY").Select
InvenA = ActiveSheet.Range("bx68")
InvenB = ActiveSheet.Range("bx69")
InvenC = ActiveSheet.Range("bx70")
End Sub
Sub InventoryABC()
Sheets("Inven1").Select
InventoryA
Sheets("Inven2").Select
InventoryB
Sheets("Inven3").Select
InventoryC
Sheets("LANE QUANTITY").Select
lookupInvenoryinfo
If InvenA < InvenB Then
InventoryA
End If
If InvenA < InvenC Then
InventoryA
End If
Sheets("LANE QUANTITY").Select
lookupInvenoryinfo
If InvenB < InvenA Then
InventoryB
End If
If InvenB < InvenC Then
InventoryB
End If
Sheets("LANE QUANTITY").Select
lookupInvenoryinfo
If InvenC < InvenA Then
InventoryC
End If
If InvenC < InvenB Then
InventoryC
End If
Sheets("LANE QUANTITY").Select
End Sub
Sub InventoryA()
Sheets("Inven1").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub
Sub InventoryB()
Sheets("Inven2").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub
Sub InventoryC()
Sheets("Inven3").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub
I need to speed this vba code.
Original thread http://www.vbaexpress.com/forum/showthread.php?t=9583
Thanks again
Option Explicit
Dim InvenA As Integer
Dim InvenB As Integer
Dim InvenC As Integer
Sub Inventory()
Do
InventoryABC
lookupInvenoryinfo
Do While InvenA = InvenB
InventoryABC
lookupInvenoryinfo
Exit Do
Loop
Loop Until InvenA = InvenB
End Sub
Sub lookupInvenoryinfo()
Sheets("LANE QUANTITY").Select
InvenA = ActiveSheet.Range("bx68")
InvenB = ActiveSheet.Range("bx69")
InvenC = ActiveSheet.Range("bx70")
End Sub
Sub InventoryABC()
Sheets("Inven1").Select
InventoryA
Sheets("Inven2").Select
InventoryB
Sheets("Inven3").Select
InventoryC
Sheets("LANE QUANTITY").Select
lookupInvenoryinfo
If InvenA < InvenB Then
InventoryA
End If
If InvenA < InvenC Then
InventoryA
End If
Sheets("LANE QUANTITY").Select
lookupInvenoryinfo
If InvenB < InvenA Then
InventoryB
End If
If InvenB < InvenC Then
InventoryB
End If
Sheets("LANE QUANTITY").Select
lookupInvenoryinfo
If InvenC < InvenA Then
InventoryC
End If
If InvenC < InvenB Then
InventoryC
End If
Sheets("LANE QUANTITY").Select
End Sub
Sub InventoryA()
Sheets("Inven1").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub
Sub InventoryB()
Sheets("Inven2").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub
Sub InventoryC()
Sheets("Inven3").Select
Range("A2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub