I have a very complex spread sheet that takes different kinds of steel (plate, wide flange, pipe, angle, etc...) and calculates the weight. Given the various types of steel I want to focus on just plate (PL) and Angle to help simplify my equation. I am not well versed in the language for VBA, but I am capable of manipulating existing code to do what I need. Below is a sample of my table:
<tbody>
</tbody>
Here are some of the details of my table:
Here is what I would like to solve:
Thank you for your help in advanced.
Row/Columns | A | B | C | D | E |
1 | TYPE | THK | WIDTH | LENGTH | WEIGHT |
2 | PL | 4.5 | 11.5 | 105.5 | 1550.53 |
3 | PL | .75 | 9.25 | 164 | 323.12 |
4 | ANGLE | .25 | 2+2 | 44 | 35.93 |
5 | ANGLE | .5 | 3+6 | 25 | 40.83 |
<tbody>
</tbody>
Here are some of the details of my table:
- E4 should equal 12.50
- E5 should equal 31.95
- I have C2:C5 defined as a named range as WIDTH=EVALUATE(C2:C5).
- Other Named ranges are as follows:
- TYPE=A2:A5
- THK=B2:B5
- LENGTH=D2:D5
- WEIGHT=E2:E5
- My simplified equation for each weight cell is as follows as an array formula:
- {=IF(A2="","",IF(A2="PL",B2*C2*D2*.284,IF(A2="ANGLE",B2*WIDTH*C2*D2*.284,"")))}
- I know in the above formula for weight, it would be unnecessary to use the array formula, but this equation is very simplified for the purpose of presenting my question.
Here is what I would like to solve:
- How can I use VBA to look for all "ANLGE" in the range A2:A5 (or named range "TYPE") and change the corresponding weight formula from array to normal?
- I am definitely open to alternative suggestions.
Thank you for your help in advanced.