Function MASSE(Volume As Double, Unité_Volume As String, Masse_Volumique As Double, Unité_Masse_Volumique As String, Unité_Masse As String)
Dim uv As Double
Dim umv As Double
Dim um As Double
Select Case Unité_Volume
Case "mm3", "mm^3"
uv = 1 / 1000000000
Case "ml", "mL", "cm3", "cm^3"
uv = 1 / 1000000
Case "cl", "cL"
uv = 1 / 100000
Case "l", "L", "dm3", "dm^3"
uv = 1 / 1000
Case "hl", "hL"
uv = 1 / 10
Case "m3", "m^3"
uv = 1
Case Else
MASSE = "Pb unité Volume"
Exit Function
End Select
Select Case Unité_Masse_Volumique
Case "kg/l", "kg/L", "kg/dm3", "kg/dm^3"
umv = 1000
Case "kg/m3", "kg/m^3", "g/l", "g/L"
umv = 1
Case "g/cm3", "g/cm^3"
umv = 1 / 1000
Case Else
MASSE = "Pb unité Masse Volumique"
Exit Function
End Select
Select Case Unité_Masse
Case "kg"
um = 1
Case "g"
um = 1 / 1000
Case Else
MASSE = "Pb unité Masse"
Exit Function
End Select
MASSE = (Volume * uv) * (Masse_Volumique * umv) / um
End Function