Forum Discussion
LearningFurther
Mar 20, 2023Copper Contributor
Formula Help
Excel Sheet 2: Column D are the different part numbers we offer. Column E is the quantity ordered on a specific Purchase order. Column H is the quantity shipped from that specific purchase order. ...
LearningFurther
Mar 29, 2023Copper Contributor
I keep getting a
Compile Error:
Expected end sub
I was able to create some simple Macros but was not able to use this code
I created a commandbutton
Private Sub CommandButton4_Click()
Sub stock()
Dim i, j As Long
Dim sum As Long
For j = 1 To 3
For i = 2 To 100
sum = Application.WorksheetFunction.SumIf(Range(Cells(2, 4), Cells(i, 4)), Sheets("Sheet1").Cells(j, 1).Value, Range(Cells(2, 11), Cells(i, 11)))
If sum > Sheets("Sheet1").Cells(j, 2).Value Then
Sheets("Sheet1").Cells(j, 3).Value = Cells(i, 9).Value
Exit For
Else
End If
Next i
Next j
End Sub
LearningFurther
Mar 29, 2023Copper Contributor
Along with a compile error: Ambiguous name detected: Stock
For product part numbers I usually use a heard "Item" and
"QTY" on sheet 2
On sheet 1
The part number would be "Inventory" and the stock level would be "On Hand"
Not sure if this changes anything in the code?
For product part numbers I usually use a heard "Item" and
"QTY" on sheet 2
On sheet 1
The part number would be "Inventory" and the stock level would be "On Hand"
Not sure if this changes anything in the code?