AC PORTA VIA
Board Regular
- Joined
- Apr 9, 2016
- Messages
- 219
- Office Version
- 365
- Platform
- Windows
code below that i found on one of the forums works but it always round up or round down numbers
if i have 21.66 and add 2.22 it should be 23.88 but it shows 23.66
if i have 21.66 and add 2.22 it should be 23.88 but it shows 23.66
VBA Code:
Sub Add_to_Inventory()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False
Sheets("ADJUST").Unprotect
Sheets("INVENTORY").Unprotect
Dim i As Long, qty As Long, sku As String, fnd As Range
With Sheets("ADJUST")
For i = 2 To .Cells(.Rows.Count, 2).End(xlUp).Row
sku = .Range("A" & i): qty = .Range("F" & i)
With Sheets("Inventory")
Set fnd = .Range("O:O").Find(sku, LookIn:=xlValues, lookat:=xlWhole)
If Not fnd Is Nothing Then
fnd.Offset(, 6) = fnd.Offset(, 6) + qty '! To remove from inventory change + to -
End If
End With
Next i
End With
Range("D2:D200").ClearContents
Range("F2:F200").ClearContents
Sheets("ADJUST").Protect
Sheets("INVENTORY").Protect
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
Last edited: