subtract quantity from sheet to another after match brand

KalilMe

Active Member
Joined
Mar 5, 2021
Messages
343
Office Version
  1. 2016
Platform
  1. Windows
hello
I have two sheets the sheet sale is invoice and sheet the result is stock so what I'm trying subtracting the quantity in sheet result from sheet sale the quantity in sheet sale is column f and in sheet result in column e it should match in sheet sale in column C,D,E with sheet result B,C,D then subtract quantity from sheet sale in column f to sheet result in column e
this is my trying but not work
VBA Code:
Sub nn()
Dim sh1, sh2 As Worksheet
Dim rngFound As Range
Set sh1 = Worksheets("sale").Columns(6)
Set sh2 = Worksheets("result")
With sh2.Columns(1)
Set rngFound = .Find(Cells(sh1.Row, 3).Value)
If Not rngFound Is Nothing Then
rngFound(1, 5).Value = rngFound(1, 5).Value - sh1.Value
            End If
    End With
End Sub
the data in sheet sale


itembrandtypeoriginquantityunit
1tune180wgthi113.00
2oil2lindo25.00

sheet result

itembrandtypeoriginquantity
1tune180wgthi234
2oil2lindo123
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top