1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| Private Sub CommandButton1_Click()
'///////////////////////////////////////////////////////////////////////////////////////////
Dim mdp As String
mdp = InputBox("Passwd please")
If mdp = "22011967" Then
'Déprotection de la feuille ici
Else
MsgBox ("Wrong Passwd")
Exit Sub
End If
'///////////////////////////////////////////////////////////////////////////////////////////
Dim fin5 As Long, fin2 As Long
Dim repons
Dim prodd As Long
Dim placc
prodd = Xprod
If prodd = 0 Then
averti6
Exit Sub
End If
If IsDate(dat) = False Then
averti4
Exit Sub
End If
If adrs = "" Then
averti2
Exit Sub
End If
If Val(nbb) = 0 Then
averti3
Exit Sub
End If
'If uniq.Value = True Then
' If Not Feuil5.Range("c:c").Find(adrs) Is Nothing _
' And xxplac = -1 Then
' repons = MsgBox("Already exist, continue ?", vbYesNo)
'End If
If repons = 7 Then
Exit Sub
' End If
End If
placc = xxplac
If placc = -1 Then
fin5 = finf5
Feuil5.Cells(fin5, 1) = prod
Feuil5.Cells(fin5, 2) = Feuil1.Cells(prodd, 2)
Feuil5.Cells(fin5, 3) = adrs
Feuil5.Cells(fin5, 4) = Val(nbb)
End If
Feuil1.Cells(prodd, 4) = Feuil1.Cells(prodd, 4) + Val(nbb)
Feuil1.Cells(prodd, 6) = Feuil1.Cells(prodd, 6) + Val(nbb)
If placc > -1 Then
Feuil5.Cells(placc, 4) = Feuil5.Cells(placc, 4) + Val(nbb)
End If
fin2 = finf2
Feuil2.Cells(fin2, 1) = CDate(dat)
Feuil2.Cells(fin2, 2) = TextBox1.Text
Feuil2.Cells(fin2, 3) = Val(nbb)
Feuil2.Cells(fin2, 4) = adrs:
vide
End Sub |
Partager