# Excell formula of VB to calculate number of pieces out of a given sheet size

#### UMAKEMESIK

##### Active Member
to all,

we work in plywood with 48 x 96" sheets or 4foot x 8 foot sheets ( same)

I am looking for a yeild formula would be best , some sort of if statement.

if it has to be VB then ok.

Starting with our standard 48 x 96 sheet.

I would like to in put 2 numbers into two cells a length cell and a width cell.

for example the part is 23 x 19 and i would like the calculation to tell me
how many i can get out of my desired sheet size of 48 x 96.

the 48 x 96 is standard, but it i could change that sheet size as well that would be great.

as we also deal in foam - which is 48 x 108

any help would be much appreciated.

thanks

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### montecarlo2012

##### Well-known Member
UMAKEMESIK
Hi, I write this little code for you I hope is the help you are looking for, I am expecting you know how to copy the code into the IDE of VBA.

this is the excel sheet

that, is the places to type your data.
and this is the code
VBA Code:
``````Sub UMAKEMESIK()
Dim LP%, WP%, FL%, WF%, X%, Y%

'///////// PLAYWOOD ////////////////
LP = Range("C4").Value
WP = Range("D4").Value
X = LP * WP
Range("F4").Value = 4608 / X

'//////// FOAM///////////////////////////////

FL = Range("C8").Value
WF = Range("D8").Value
Y = FL * WF
Range("F8").Value = Y
End Sub``````
now you can input your values for the playwood on C4 and D4, and for the foam on C8 and D8 just click play on the IDE or create a buttom.
have a nice day

#### montecarlo2012

##### Well-known Member
sorry on range("f8").value = y
must be
range("F8").value = 5184/Y
then will work perfect

Replies
13
Views
209
Replies
3
Views
58
Replies
5
Views
54
Replies
7
Views
219
Replies
3
Views
51