Ну тебе ведь точно показали в посте№2 как делать
Пробуй разжеванное
Option Explicit
Sub dummy_test()
Dim itypes As Variant
itypes = Array("1x1.5", "2x1.5", "3x1.5", "4x1.5", "5x1.5", "6x1.5") '<-list of types
Dim styles As Variant
styles = Array("ВВГнгLS-1", "ВВГнгLS-2", "ВВГнгLS-3", "ВВГнгLS-4", "ВВГнгLS-5") ' e.t.c....
Dim style As String
style = styles(4) '<---"ВВГнгLS-5"
Debug.Print style
Dim itype As String
itype = itypes(1) '<---"2x1.5"
Debug.Print itype
Dim leng As Double
leng = 10.5
Debug.Print leng
Dim result As Double
result = GetResult(style, leng) * GetCoefficent(itype)
MsgBox Round(result, 2)
End Sub
Function GetCoefficent(ByVal style As String) As Double
Dim formula As String
Select Case style
Case "1x1.5"
GetCoefficent = 0.5 '<--change value
Case "2x1.5"
GetCoefficent = 1# '<--change value
Case "3x1.5"
GetCoefficent = 1.2 '<--change value
Case "4x1.5"
GetCoefficent = 1.4 '<--change value
Case "5x1.5"
GetCoefficent = 1.5 '<--change value
Case "6x1.5"
GetCoefficent = 2# '<--change value
End Select
End Function
Function GetResult(ByVal style As String, ByVal B As Double) As Double
Select Case style
Case "ВВГнгLS-1"
GetResult = B * 1 * 1.5 / 1000 '<--change expression
Case "ВВГнгLS-2"
GetResult = B * 2 * 1 / 1000 '<--change expression
Case "ВВГнгLS-3"
GetResult = B * 1 * 1.5 / 1000 '<--change expression
Case "ВВГнгLS-4"
GetResult = B * 1 * 1.5 / 1000 '<--change expression
Case "ВВГнгLS-5"
GetResult = B * 4 * 1.5 / 1000 '<--change expression
End Select
End Function