IF Function and msgbox

C

CC

Gentle people


I'm a beginner... real beginner .. and I have this problem
I have two inpuBox with two questions about the amount of materials ( eg.
amount of Material A and Amount of Material B)
then I made calculations ( eg. material A 2000 litrs * dens 1.3 = 2600 kg
and material B 1000 litrs * dens 1.3 = 1300 kg) and my problem is made a
Msgbox show the bigest

Can you hlp ?
 
T

Toppers

msgbox max(calc1,calc2) & "is the biggest!"

where calc1=material A 2000 litrs * dens 1.3 = 2600 kg
calc2=material B 1000 litrs * dens 1.3 = 1300 kg

HTH
 
C

CC

It's great Toopers
Thanks a lot

One more thing ... How can I put name instead of number

(eg Material A is the bigest)

cc
 
T

Toppers

How do we identify Material A? Is it an a cell?

If Calc1>Calc2 then
msgbox "Material A is biggest"
else
msgbox "Material B is biggest"
End if


Or

If Calc1>Calc2 then
msgbox range("A1") & " is biggest"
else
msgbox range("A2") & " is biggest"

End if

A1 contains "Material A", A2 contains "Material B"

HTH
 
Top