Can someone explain this?
if textbox M0F1 is 1,2 and
textbox M1F1 is 2,2
ill get my msgbox that it is max? 2,2 - 1,2 = 1 not bigger than 1!!
if i change the numbers to 2,1 - 1,1 its ok and 2,3 - 1,3 is ok!!
if textbox M0F1 is 1,2 and
textbox M1F1 is 2,2
ill get my msgbox that it is max? 2,2 - 1,2 = 1 not bigger than 1!!
if i change the numbers to 2,1 - 1,1 its ok and 2,3 - 1,3 is ok!!
Code:
Private Sub CommandButton1_Click()
'Kontrolera att användaren har matat in värden i alla textrutor
If M0F1 = Nill Then MsgBox ("Bla bla bla")
If M0F2 = Nill Then MsgBox ("ble ble ble")
If M0F3 = Nill Then MsgBox ("blu blu blu")
If M1F1 = Nill Then MsgBox ("bli bli bli")
If M1F1 = Nill Then MsgBox ("sensured")
If M1F1 = Nill Then MsgBox ("top secret")
If M1F1 = Nill Then MsgBox ("You wish")
If M1F1 = Nill Then MsgBox ("Maby if u ask")
If M1F1 = Nill Then MsgBox ("later")
'Byt ut alla . mot ,
M0F1 = Replace(M0F1, ".", ",")
M1F1 = Replace(M1F1, ".", ",")
M2F1 = Replace(M2F1, ".", ",")
M0F2 = Replace(M0F2, ".", ",")
M1F2 = Replace(M1F2, ".", ",")
M2F2 = Replace(M2F2, ".", ",")
M0F3 = Replace(M0F3, ".", ",")
M1F3 = Replace(M1F3, ".", ",")
M2F3 = Replace(M2F3, ".", ",")
'Kontrollera att det är rätt mängd
gramFärgF1 = M1F1 - M0F1
gramFärgF2 = M1F2 - M0F2
gramFärgF3 = M1F3 - M0F3
test = gramFärgF1
Min = 0.8
Max = 1
If gramFärgF1 > Max Then MsgBox ("Du har mer än 1 gram färg i form 1, gör om provet med mindre färg")
If gramFärgF1 < Min Then MsgBox ("Du har mindre än 0.8 gram färg i form 1, gör om provet med mer färg")
If gramFärgF2 > Max Then MsgBox ("Du har mer än 1 gram färg i form 2, gör om provet med mindre färg")
If gramFärgF2 < Min Then MsgBox ("Du har mindre än 0.8 gram färg i form 2, gör om provet med mer färg")
If gramFärgF3 > Max Then MsgBox ("Du har mer än 1 gram färg i form 3, gör om provet med mindre färg")
If gramFärgF3 < Min Then MsgBox ("Du har mindre än 0.8 gram färg i form 3, gör om provet med mer färg")