ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF Function and msgbox (https://www.excelbanter.com/excel-worksheet-functions/100153-if-function-msgbox.html)

CC

IF Function and msgbox
 
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 ?


Toppers

IF Function and msgbox
 
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

"CC" wrote:

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 ?


CC

IF Function and msgbox
 
Hi Toopers

I have this error msg


"Sub or Function not defined"

CC



"Toppers" wrote:

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

"CC" wrote:

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 ?


Toppers

IF Function and msgbox
 
sorry ..... put

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


"CC" wrote:

Hi Toopers

I have this error msg


"Sub or Function not defined"

CC



"Toppers" wrote:

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

"CC" wrote:

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 ?


CC

IF Function and msgbox
 
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

"Toppers" wrote:

sorry ..... put

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


"CC" wrote:

Hi Toopers

I have this error msg


"Sub or Function not defined"

CC



"Toppers" wrote:

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

"CC" wrote:

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 ?


Toppers

IF Function and msgbox
 
How do we identify Material A? Is it an a cell?

If Calc1Calc2 then
msgbox "Material A is biggest"
else
msgbox "Material B is biggest"
End if


Or

If Calc1Calc2 then
msgbox range("A1") & " is biggest"
else
msgbox range("A2") & " is biggest"

End if

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

HTH

"CC" wrote:

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

"Toppers" wrote:

sorry ..... put

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


"CC" wrote:

Hi Toopers

I have this error msg


"Sub or Function not defined"

CC



"Toppers" wrote:

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

"CC" wrote:

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 ?


CC

IF Function and msgbox
 
Many Thanks Toopers

Look so easy when we Know ....

cc

"Toppers" wrote:

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

If Calc1Calc2 then
msgbox "Material A is biggest"
else
msgbox "Material B is biggest"
End if


Or

If Calc1Calc2 then
msgbox range("A1") & " is biggest"
else
msgbox range("A2") & " is biggest"

End if

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

HTH

"CC" wrote:

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

"Toppers" wrote:

sorry ..... put

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


"CC" wrote:

Hi Toopers

I have this error msg


"Sub or Function not defined"

CC



"Toppers" wrote:

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

"CC" wrote:

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 ?



All times are GMT +1. The time now is 03:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com