OVH Cloud OVH Cloud

erreur de compatibilité And et Or ?

1 réponse
Avatar
Golf
Bonjour

J'essaie de mettre au point ce type d'=E9criture, mais cela=20
plante,comme cela fait depuis ce matin que je cherche,=20
j'ai besoin d'aide afin de comprendre.
Merci beaucoup
Golf

Sheets("Params").Unprotect password:=3D"toto"
If frm_table.Lbl_type.Caption =3D "L'addition" And _
frm_table.Lbl_total.Caption =3D 20 And _
Sheets("Params").[F3] =3D 0 Or _
Sheets("Params").[F3] < Sheets("Params").[F1] Then
Sheets("Params").[F3] =3D Sheets("Params").[F1]
'frm_table.Lbl_f=E9licitations.Visible =3D True
frm_noms_records.Show
Sheets("Params").Protect password:=3D"toto"

1 réponse

Avatar
papou
Bonjour
Comme ça vite fait non testé :
Sheets("Params").Unprotect Password:="toto"
If frm_table.Lbl_type.Caption = "L'addition" Then
If frm_table.Lbl_total.Caption = 20 Then
If Sheets("Params").[F3] = 0 Or _
Sheets("Params").[F3] < Sheets("Params").[F1] Then
Sheets("Params").[F3] = Sheets("Params").[F1]
'frm_table.Lbl_félicitations.Visible = True
frm_noms_records.Show
Sheets("Params").Protect Password:="toto"
End If
End If
End If

Personnellement je trouve que c'est plus lisible

Cordialement
Pascal


"Golf" a écrit dans le message de
news:239d701c45ea5$eb1bf7f0$
Bonjour

J'essaie de mettre au point ce type d'écriture, mais cela
plante,comme cela fait depuis ce matin que je cherche,
j'ai besoin d'aide afin de comprendre.
Merci beaucoup
Golf

Sheets("Params").Unprotect password:="toto"
If frm_table.Lbl_type.Caption = "L'addition" And _
frm_table.Lbl_total.Caption = 20 And _
Sheets("Params").[F3] = 0 Or _
Sheets("Params").[F3] < Sheets("Params").[F1] Then
Sheets("Params").[F3] = Sheets("Params").[F1]
'frm_table.Lbl_félicitations.Visible = True
frm_noms_records.Show
Sheets("Params").Protect password:="toto"