Hi! I am a beginner in VBA and unfortunately I cannot come up with a solution for my problem. Hopefully someone can help me at least with some suggestions how to do it.
Hõiva.PNG
I would like to create a macro, which should be calculating the inventory in EUR at the end of each period (in this example for each cell in range B5:N5). The inventory amount comes from cost of goods sold (row 3) based on given number of days (row 4). The number of days is a input from the user and can be any positive number. In my example in B5 the amount comes from cost of goods sold in January, February and partially in March, because number of days in B4 is reached in March (31 days in January, 29 days in February and 90-31-29=30 days in March). The calculation is then following 250(C3)+300(D3)+450(E3)/31(E2)*(90(B4)-31(C2)-29(D2)).
I have attached also the Excel file, where you can see which values should be calculated based on the VBA code.
Thank you!
Bookmarks