If material = "Single Bricks" Then qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.Text &" "& material
qtytxt1.text= "bricks"
If material = "Single Bricks" Then
qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.Text &" "& material
qtytxt1.text= "bricks"
End If
If material = "Single Bricks" Then
qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.Text &" "& material
qtytxt1.text= "bricks"
End If
If material = "Single Blocks" Then
qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
qtytxt1.text= "blocks"
End If
If material = "Single Paving Blocks" Then
qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Flags 900x600" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Flags 750x600" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Flags 600x600" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Flags 450x450" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Flags 400x400" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Flags 300x300" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Plasterbord 2400x1200" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Plasterbord 1800x900" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Plasterbord 2400x900" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Single Plasterbord 1220x900" Then
qtyunround = (sumtotm2 / divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "None m2 only" Then
qtytxt.Text = ""
'Convert m3 to tonnes for appropriate materials
End If
If material = "m3 Concrete" Then
qtyunround = (sumtotm3)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Tonnes Sand" Then
qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Tonnes Soil" Then
qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Tonnes Tarmac" Then
qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
If material = "Tonnes MotType1" Then
qtyunround = (sumtotm3 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
End If
' All these materials have the same code with only qtyunround varying, so put the code in a Sub and send it
' the qtyunround calculation as a passed value
' Being clever we can then return that value to store in qtyunround.
' If qtyunround is only used for these calcs, we could simplify by not having qtyunround at all, and not have the sub return anything
If material = "Single Bricks" Then ' Using the multiline If..Then as we need to set qtytxt1.text
qtyunround = CalcMaterial (sumtotm2 * divider) ' Note we send it the calculation for qtyunround to use, and get it back in the return
qtytxt1.text= "bricks"
End If
If material = "Single Blocks" Then ' Using the multiline If..Then as we need to set qtytxt1.text
qtyunround = CalcMaterial (sumtotm2 * divider)
qtytxt1.text= "blocks"
End If
If material = "Single Paving Blocks" Then qtyunround = CalcMaterial (sumtotm2 * divider)' Single line If... Then as we only need CalcMaterial
If material = "Single Flags 900x600" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Flags 750x600" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Flags 600x600" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Flags 450x450" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Flags 400x400" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Flags 300x300" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Plasterbord 2400x1200" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Plasterbord 1800x900" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Plasterbord 2400x900" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "Single Plasterbord 1220x900" Then qtyunround = CalcMaterial (sumtotm2 / divider)
If material = "None m2 only" Then qtytxt.Text = ""
'Convert m3 to tonnes for appropriate materials
If material = "m3 Concrete" Then qtyunround = CalcMaterial (sumtotm3)
If material = "Tonnes Sand" Then qtyunround = CalcMaterial (sumtotm3 * divider)
If material = "Tonnes Soil" Then qtyunround = CalcMaterial (sumtotm3 * divider)
If material = "Tonnes Tarmac" Then qtyunround = CalcMaterial (sumtotm3 * divider)
If material = "Tonnes MotType1" Then qtyunround = CalcMaterial (sumtotm3 * divider)
' sub used
Sub CalcMaterial (Value As Double)' value is qtyunround from your earlier code so we can set it here
qtytxt.text = Round2(Value,1)
qtytxt.text = qtytxt.text &" "& material
Return (Value)' Send back value so qtyunround gets the correct value
End Sub
Select material
' Select workds by taking the variable given and comparing it to the value(s) listed after the case statement
' If there is a match, the code up to the next case is excecuted, then it skips to the code after End Select
' As you have the same operations on lots of materials, we can group them together
' to minimise the lines of code
Case "Single Bricks"
qtyunround = CalcMaterial (sumtotm2 * divider)
qtytxt1.text= "bricks"
Case "Single Blocks"
qtyunround = CalcMaterial (sumtotm2 * divider)
qtytxt1.text= "blocks"
Case "Single Paving Blocks"
qtyunround = CalcMaterial (sumtotm2 * divider)
Case "Single Flags 900x600", "Single Flags 750x600", "Single Flags 600x600", "Single Flags 450x450", "Single Flags 400x400", _
"Single Flags 300x300", "Single Plasterbord 2400x1200", "Single Plasterbord 1800x900", "Single Plasterbord 2400x900", _
"Single Plasterbord 1220x900"
qtyunround = CalcMaterial (sumtotm2 / divider)
Case "None m2 only"
qtytxt.Text = ""
Case "m3 Concrete"
qtyunround = CalcMaterial (sumtotm3)
Case "Tonnes Sand", "Tonnes Soil", "Tonnes Tarmac", "Tonnes MotType1"
qtyunround = CalcMaterial (sumtotm3 * divider)
End Select
' sub used
Sub CalcMaterial (Value As Double)
qtytxt.text = Round2(Value,1)
qtytxt.text = qtytxt.text &" "& material
Return (Value)
End Sub
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Single Bricks" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]OR[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Single Blocks" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]OR[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Single Paving Blocks" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] qtytxt1.text= material.SubString2([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]7[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],material.Length-[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]7[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]) [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' extracts the second part of material[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] qtyunround = sumtotm2 * divider[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Else [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material.SubString2([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]12[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Single Flags" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]OR[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material.SubString2([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]18[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Single Plasterbord" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] qtyunround = sumtotm2 / divider[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Else [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material.SubString2([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]6[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Tonnes" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] qtyunround = (sumtotm3 * divider)[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Else [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"None m2 only" [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]'Convert m3 to tonnes for appropriate materials[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] Return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' needed if you want to avoid the execution of the last line[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Else [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] material = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"m3 Concrete"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] qtyunround = sumtotm3[/SIZE][/FONT]
[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Else[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] Return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' quits the routine if no match[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/FONT]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]' qtytxt.text = Round2(qtyunround,1)[/COLOR][/SIZE][/FONT]
[SIZE=2][FONT=Courier New][COLOR=#008000]' qtytxt.text = qtytxt.Text &" "& material[/COLOR][/FONT][/SIZE]
[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]qtytxt.text = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Round2[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2](qtyunround,[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]) &[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]" "[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]& material [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]'the two previous lines in one line[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
I had seen this but I found it more 'precise' having "Paving Blocks" instead of "Blocks".qtytxt1.text is being set to "Blocks" for "Single Paving Blocks" - that is not in the original code
I agree with you for the readability, on the other hand with new items in a known category no code change needed. For me this advantage overcomes the lack readability. But as you say, this is also personal preference.... does get the required result in a more compact form, but to me it loses some of its readability and flexibility ...
You are misunderstanding me, qtytxt1.text is not set to anything for "Single Paving Blocks" in the original code. Quoting the relevant snip of the original:I had seen this but I found it more 'precise' having "Paving Blocks" instead of "Blocks".
........................
Best regards.
If material = "Single Paving Blocks" Then qtyunround = (sumtotm2 * divider)
qtytxt.text = Round2(qtyunround,1)
qtytxt.text = qtytxt.text &" "& material
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?