A Super Simple Inventory Automation System @Exceltrainingvideos
A Super Simple Inventory Automation System  @Exceltrainingvideos
Uploaded January 2020 | Updated September 2026, 2 weeks ago
How to create a super simple inventory automation system quickly and easily using the SUMIFS function with VBA.
Here's the complete VBA code:
Option Explicit

Sub myStock()
Dim prodID As String
Dim stockQty As Long
prodID = InputBox("Enter product ID to check quantity available.")

Dim rA As Range, rB As Range, rC As Range

With Worksheets("Sheet1")
Set rB = .Range("B2", Range("B" & Rows.Count).End(xlUp))
Set rA = .Range("A2", Range("A" & Rows.Count).End(xlUp))
Set rC = .Range("C2", Range("C" & Rows.Count).End(xlUp))
End With

stockQty = Application.WorksheetFunction.SumIfs( _
rC, rA, prodID, rB, "Purchase") - Application.WorksheetFunction.SumIfs( _
rC, rA, prodID, rB, "Sale") + Application.WorksheetFunction.SumIfs( _
rC, rA, prodID, rB, "Return")

MsgBox "The quantity of item " & prodID & " available is " & stockQty
Range("F3") = stockQty
End Sub
A Super Simple Inventory Automation SystemAnalyze Data Using DGET FunctionPower BI Desktop Data Analysis VisualizationsHow to Open Most Recent File from Specific FolderDump Web Page Data into Worksheet | 2021Automate Slicer Creation Using Table Data2021 | Forgot Excel Password | How to Remove a Password from Excel | 100% SuccessUpdate Master Sheet with a ClickCreate Searchbox Using Filter Function AutomaticallyUser-form to Manage Data AutomaticallyHow to move from one control to another in a form on worksheetAutomate Copying of Master Worksheet || 2021
Dinesh Kumar Takyar |

A Super Simple Inventory Automation System

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER