Hello, looking for some help VBA or otherwise. Total WOS starts A1. B2 is a calculation of =16.5-A2 which gives us 9.5. I need a VBA for as follows if B3 is between 95% and 100 I want the value in B2 to be 4 unless it is already greater than 4 like in the example below. In this case I would want to keep it at 9.5. In B2 for example the % on hand is 75% anything between 75 and 79 I would want to be a value of 6.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]TOTAL WOS[/TD]
[TD]ORDER WOS[/TD]
[TD]% ON Hand[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]9.5[/TD]
[TD]98%[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]4.5[/TD]
[TD]75%[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]13.5[/TD]
[TD]92%[/TD]
[/TR]
</tbody>[/TABLE]
The Value ranges I am looking for are as follows:[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]% On Hand[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] Value [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]95% - 100%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 4.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]93% - 95%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]4.50[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]90% - 92%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 4.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]85% - 89%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 5.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]83% - 84%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 5.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]80% - 82%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 5.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]75% - 79%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 6.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]73% - 74%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 6.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]70% - 72%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 6.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]65% - 69%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 7.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]63% - 64%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 7.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]60% - 62%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 7.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]55% - 59%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 8.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]53% - 54%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 8.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]50% - 52%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 8.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]45% - 49%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 9.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]43% - 44%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 9.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]40% - 42%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 9.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]35% - 39%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10.0[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]33% - 34%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10.50
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]30% - 32%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10.75[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]25% - 29%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11.0[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]23% - 24%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11.50
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]20% - 23%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11.75
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]0% - 19%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]12.0[/TD]
[/TR]
</tbody>[/TABLE]
SO if the calculation in column B ends up being greater than the values in the list above I would like it to remain as is. If the calculation is lower I would like that number to be the value within the range. Please let me know if this makes sense and or if it is possible.
Thank you for your help!
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]TOTAL WOS[/TD]
[TD]ORDER WOS[/TD]
[TD]% ON Hand[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]9.5[/TD]
[TD]98%[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]4.5[/TD]
[TD]75%[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]13.5[/TD]
[TD]92%[/TD]
[/TR]
</tbody>[/TABLE]
The Value ranges I am looking for are as follows:[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]% On Hand[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] Value [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]95% - 100%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 4.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]93% - 95%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]4.50[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]90% - 92%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 4.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]85% - 89%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 5.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]83% - 84%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 5.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]80% - 82%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 5.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]75% - 79%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 6.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]73% - 74%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 6.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]70% - 72%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 6.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]65% - 69%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 7.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]63% - 64%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 7.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]60% - 62%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 7.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]55% - 59%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 8.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]53% - 54%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 8.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]50% - 52%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 8.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]45% - 49%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 9.00 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]43% - 44%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 9.50 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]40% - 42%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 146"]
<tbody>[TR]
[TD="class: xl66, width: 146"] 9.75 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]35% - 39%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10.0[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]33% - 34%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10.50
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]30% - 32%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10.75[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]25% - 29%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11.0[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]23% - 24%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11.50
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]20% - 23%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11.75
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102"]0% - 19%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]12.0[/TD]
[/TR]
</tbody>[/TABLE]
SO if the calculation in column B ends up being greater than the values in the list above I would like it to remain as is. If the calculation is lower I would like that number to be the value within the range. Please let me know if this makes sense and or if it is possible.
Thank you for your help!