Problème de conditions

didibzh

XLDnaute Nouveau
Bonjour a tous, voila j'ai un petit problème voici mon code

Code:
Private Sub Validation_woodline_Click()
'--------------SOMME MURAUX------------------
TOTALW = WC1_660.Value + WC1_750.Value + WC1_1000.Value + WC2_660.Value + WC2_750.Value + WC2_1000.Value + WC3_660.Value + WC3_750.Value + WC3_1000.Value + WC4_660.Value + WC4_750.Value + WC4_1000.Value + WC5_660.Value + WC5_750.Value + WC5_1000.Value + WC6_660.Value + WC6_750.Value + WC6_1000.Value
'---------------------------------------------
If WC1_660.Value And WC1_750.Value And WC1_1000.Value = 0 Then
GoTo coupe2
Else
'Copie mise en forme
Sheets("1").Select
    Range("A1:I25").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(5, 2).Range("A1").Select
ActiveCell.Value = WC1_660.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC1_750.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC1_1000.Value
'Retour à l'origine
ActiveCell.Offset(-7, -2).Range("A1").Select

'-----------------PRIX--------------------
'Déplacement de**
ActiveCell.Offset(5, 5).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
'Retour à l'origine
ActiveCell.Offset(-7, -5).Range("A1").Select
End If
'----------------------------------------
ActiveCell.Offset(26, 0).Range("A1").Select


coupe2:
If WC2_660.Value And WC2_750.Value And WC2_1000.Value = 0 Then
GoTo Coupe3
Else
'Copie mise en forme
Sheets("1").Select
    Range("A1:I25").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(5, 2).Range("A1").Select
ActiveCell.Value = WC2_660.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC2_750.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC2_1000.Value
'Retour à l'origine
ActiveCell.Offset(-7, -2).Range("A1").Select

'-----------------PRIX--------------------
'Déplacement de**
ActiveCell.Offset(5, 5).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
'Retour à l'origine
ActiveCell.Offset(-7, -5).Range("A1").Select
End If


'----------------------------------------
ActiveCell.Offset(26, 0).Range("A1").Select

Coupe3:
If WC3_660.Value And WC3_750.Value And WC3_1000.Value = 0 Then
GoTo coupe4
Else
'Copie mise en forme
Sheets("1").Select
    Range("A1:I25").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(5, 2).Range("A1").Select
ActiveCell.Value = WC3_660.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC3_750.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC3_1000.Value
'Retour à l'origine
ActiveCell.Offset(-7, -2).Range("A1").Select

'-----------------PRIX--------------------
'Déplacement de**
ActiveCell.Offset(5, 5).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
'Retour à l'origine
ActiveCell.Offset(-7, -5).Range("A1").Select
End If


'----------------------------------------
ActiveCell.Offset(26, 0).Range("A1").Select

coupe4:
If WC4_660.Value And WC4_750.Value And WC4_1000.Value = 0 Then
GoTo coupe5
Else
'Copie mise en forme
Sheets("1").Select
    Range("A1:I25").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(5, 2).Range("A1").Select
ActiveCell.Value = WC4_660.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC4_750.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC4_1000.Value
'Retour à l'origine
ActiveCell.Offset(-7, -2).Range("A1").Select
'-----------------PRIX--------------------
'Déplacement de**
ActiveCell.Offset(5, 5).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
'Retour à l'origine
ActiveCell.Offset(-7, -5).Range("A1").Select
End If

'----------------------------------------
ActiveCell.Offset(26, 0).Range("A1").Select

coupe5:
If WC5_660.Value And WC5_750.Value And WC5_1000.Value = 0 Then
GoTo coupe6
Else
'Copie mise en forme
Sheets("1").Select
    Range("A1:I25").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(5, 2).Range("A1").Select
ActiveCell.Value = WC5_660.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC5_750.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC5_1000.Value
'Retour à l'origine
ActiveCell.Offset(-7, -2).Range("A1").Select
'-----------------PRIX--------------------
'Déplacement de**
ActiveCell.Offset(5, 5).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
'Retour à l'origine
ActiveCell.Offset(-7, -5).Range("A1").Select
End If

'----------------------------------------
ActiveCell.Offset(26, 0).Range("A1").Select

coupe6:
If WC6_660.Value And WC6_750.Value And WC6_1000.Value = 0 Then
GoTo accessoires
Else
'Copie mise en forme
Sheets("1").Select
    Range("A1:I25").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(5, 2).Range("A1").Select
ActiveCell.Value = WC6_660.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC6_750.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = WC6_1000.Value
'Retour à l'origine
ActiveCell.Offset(-7, -2).Range("A1").Select

'-----------------PRIX--------------------
'Déplacement de**
ActiveCell.Offset(5, 5).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWMB.Value = True Then
ActiveCell.Value = "1"
Else
ActiveCell.Value = "2"
End If
'Retour à l'origine
ActiveCell.Offset(-7, -5).Range("A1").Select
End If

'----------------------------------------
ActiveCell.Offset(26, 0).Range("A1").Select

accessoires:
'Copie mise en forme
Sheets("2").Select
    Range("A1:I22").Select
    Selection.Copy
    Sheets("Devis").Select
    Selection.Insert Shift:=xlDown
'Déplacement de**
ActiveCell.Offset(2, 2).Range("A1").Select
ActiveCell.Value = QMWAH.Value
ActiveCell.Offset(1, 0).Range("A1").Select
'-----------------------------------------
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWER.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWHU.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWFL.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWDF.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWRM.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWPE.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWBC.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWB.Value
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveCell.Value = QMWBS.Value

'-----------OPTION KOMACEL----------------
ActiveCell.Offset(6, 0).Range("A1").Select
If QMWKB.Value = True Then
ActiveCell.Value = TOTALW
Else
ActiveCell.Value = ""
End If
'-----------OPTION TEXTE ADHESIF----------------
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWTA.Value = True Then
ActiveCell.Value = TOTALW
Else
ActiveCell.Value = ""
End If

'-----------OPTION IMAGES GENERIQUES----------------
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWIG.Value = True Then
ActiveCell.Value = TOTALW
Else
ActiveCell.Value = ""
End If

'-----------OPTION SOCLE PLINTHE----------------
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWSP.Value = True Then
ActiveCell.Value = TOTALW
Else
ActiveCell.Value = ""
End If

'-----------OPTION GELATINE----------------
ActiveCell.Offset(1, 0).Range("A1").Select
If QMWG.Value = True Then
ActiveCell.Value = TOTALW
Else
ActiveCell.Value = ""
End If

'Retour à l'origine
ActiveCell.Offset(-22, -2).Range("A1").Select

End Sub

sa bloc ici "If WC1_660.Value And WC1_750.Value And WC1_1000.Value = 0 Then" mais je pense que j'ai fait d'autre erreurs au niveaux des conditions

si quelqu'un peut m'éclairer merci par avance
 

Discussions similaires

Statistiques des forums

Discussions
312 897
Messages
2 093 393
Membres
105 720
dernier inscrit
gumoreau