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

UMAKEMESIK

Active Member
Joined
Oct 3, 2005
Messages
371
to all,
Thanks in Advance.

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
 

Some videos you may like

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
Joined
Jan 26, 2011
Messages
612
Office Version
  1. 2010
Platform
  1. Windows
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
1597104286596.png

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
Joined
Jan 26, 2011
Messages
612
Office Version
  1. 2010
Platform
  1. Windows
sorry on range("f8").value = y
must be
range("F8").value = 5184/Y
then will work perfect
 

Watch MrExcel Video

Forum statistics

Threads
1,114,236
Messages
5,546,672
Members
410,753
Latest member
Ian R
Top