Share Transaction to Inventory in excel VBA using Macro

mohi021

New Member
Joined
Jan 17, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hello guys!

I want to write a macro to receive data from the 'Transaction' sheet and gives me an 'Inventory' sheet but I don't know how to do it

(the 'Transaction' sheet may contain many shares so the macro should count them all and if we sell a share that we don't have in the first place,(short it) it should warn us)
from

transaction help.xlsx
ABCDE
1TickerTranactionAmountBuy/Sell Price
2Share1Buy4,0006,582
3Share2Buy1,2408,065
4Share3Buy1,9405,930
5Share1Buy6,0007,737
6Share1Buy15,0007,989
7Share4Buy2,0007,234
8Share4Buy1,0007,234
9Share1Sell5,0107,124
10Share5Buy1,0002,110
11Share6Buy13,0007,536
12Share7Buy3,0006,014
13Share5Sell1,0002,287
14Share8Buy1,50027,734
15Share1Buy2,3008,700
16Share7Sell2,0006,145
17
Transaction



to

transaction help.xlsx
ABCDEFGHIJ
1TickerBuy VolumeCostAverage Buying PriceSell VolumeSell AmountAverage Sell PriceInventoryProfit/Loss
2Share127,300211,547,7007,7495,01035,691,2407,12422,290(3,131,250)
3Share21,24010,000,6008,065-1,240-
4Share31,94011,504,2005,930-1,940-
5Share43,00021,702,0007,234-3,000-
6Share51,0002,110,0002,1101,0002,287,0002,287 - 177,000
7Share613,00097,968,0007,536-13,000-
8Share73,00018,042,0006,0142,00012,290,0006,1451,000262,000
9Share81,50041,601,00027,734-1,500-
10
11
12414,475,500
Inventory
Cell Formulas
RangeFormula
F2:F9,C2:C9C2=B2*D2
I2:I9I2=E2*(G2-D2)
C12C12=SUM(C2:C9)



could you please help me??

:cry::cry:

Also asked here Transaction to Inventory excel VBA using macro - OzGrid Free Excel/VBA Help Forum
and here Transaction to Inventory excel VBA using macro
 
Last edited by a moderator:

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,976
Messages
6,122,539
Members
449,088
Latest member
RandomExceller01

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