Voilà le début du code de ma macro avec ce que j'ai tenté (et qui ne marche pas bien sûr) concernant mon message d'alerte pour les codes clients éronés!
Dim CodeClient As Integer
Dim contenu As String
Dim Box As Integer
Dim Feuill1 As String
Feuill1 = 1
Range("D4").Select
contenu = ActiveCell.Value
If ActiveCell.Value = "" Then
Box = MsgBox("Veuillez Saisir un code client dans la cellule D4!", 0, "Attention")
ElseIf ActiveCell.Value <> ("J2" And "M2" And "P2" And "S2" And "V2" And "Y2" And "AB2" And "AE2" And "AH2" And "AK2" And "AN2" And "AQ2" And "AT2" And "AW2" And "AZ2" And "BC2" And "BF2" And "BI2" And "BL2" And "BO2" And "BR2" And "BU2" And "BX2" And "CA2" And "CD2" And "CG2" And "CJ2" And "CM2" And "CP2" And "CS2" And "CV2" And "CY2" And "DB2" And "DE2" And "DH2" And "DK2" And "DN2" And "DQ2" And "DT2" And "DW2" And "DZ2" And "EC2" And "EF2" And "EI2" And "EL2" And "EO2" And "ER2" And "EU2" And "EX2" And "FA2" And "FD2" And "FG2" And "FJ2" And "FM2" And "FP2" And "FS2" And "FV2" And "FY2" And "GB2" And "GE2" And "GH2" And "GK2" And "GN2" And "GQ2" And "GT2" And "GW2" And "GZ2" And "HC2" And "HF2" And "HI2" And "HL2" And "HO2" And "HR2" And "HU2" And "HX2" And "IA2" And "ID2" And "IG2" And "IJ2" And "IM2" And "IP2" And "IS2") Then
Box = MsgBox("Le code que vous avez saisi ne correspond à aucun code client!", 0, "Attention")
Else
Range("J2").Select
If contenu = ActiveCell.Value Then
CodeClient = 11
End If