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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
| Private Sub CommandButton1_Click()
Dim quoi As Variant
Dim trouve As Range
quoi = ComboBox1
With Sheets("feuil1").Range("c15:c65536")
Set trouve = .Find(quoi, lookat:=xlWhole)
If Not trouve Is Nothing Then
trouve.Offset(0, -2) = TextBox1.Text
trouve.Offset(0, -1) = TextBox2.Text
trouve.Offset(0, 1) = TextBox3.Text
trouve.Offset(0, 3) = TextBox4.Text
trouve.Offset(0, 4) = TextBox5.Text
trouve.Offset(0, 5) = TextBox6.Text
trouve.Offset(0, 6) = TextBox7.Text
trouve.Offset(0, 7) = TextBox8.Text
trouve.Offset(0, 8) = TextBox9.Text
trouve.Offset(0, 9) = TextBox10.Text
trouve.Offset(0, 10) = TextBox11.Text
trouve.Offset(0, 11) = TextBox12.Text
trouve.Offset(0, 12) = TextBox13.Text
trouve.Offset(0, 13) = TextBox14.Text
trouve.Offset(0, 14) = TextBox15.Text
trouve.Offset(0, 15) = TextBox16.Text
trouve.Offset(0, 16) = TextBox17.Text
trouve.Offset(0, 17) = TextBox18.Text
trouve.Offset(0, 18) = TextBox19.Text
trouve.Offset(0, 19) = TextBox20.Text
trouve.Offset(0, 20) = TextBox21.Text
trouve.Offset(0, 21) = TextBox22.Text
trouve.Offset(0, 22) = TextBox23.Text
trouve.Offset(0, 23) = TextBox24.Text
trouve.Offset(0, 24) = TextBox25.Text
trouve.Offset(0, 25) = TextBox26.Text
trouve.Offset(0, 26) = TextBox27.Text
trouve.Offset(0, 27) = TextBox28.Text
trouve.Offset(0, 28) = TextBox29.Text
trouve.Offset(0, 29) = TextBox30.Text
trouve.Offset(0, 30) = TextBox31.Text
trouve.Offset(0, 31) = TextBox32.Text
trouve.Offset(0, 32) = TextBox33.Text
trouve.Offset(0, 33) = TextBox34.Text
trouve.Offset(0, 34) = TextBox35.Text
trouve.Offset(0, 35) = TextBox36.Text
trouve.Offset(0, 36) = TextBox37.Text
If OptionButton1.Value = True Then
trouve.Offset(0, 2) = OptionButton1.Caption
ElseIf OptionButton2.Value = True Then
trouve.Offset(0, 2) = OptionButton2.Caption
ElseIf OptionButton3.Value = True Then
trouve.Offset(0, 2) = OptionButton3.Caption
ElseIf OptionButton4.Value = True Then
trouve.Offset(0, 2) = OptionButton4.Caption
ElseIf OptionButton5.Value = True Then
trouve.Offset(0, 2) = OptionButton5.Caption
ElseIf OptionButton6.Value = True Then
trouve.Offset(0, 2) = OptionButton6.Caption
End If
Set ref = Columns(3).Find(what:=ComboBox1.Value, lookat:=xlWhole)
If Not ref Is Nothing Then
ref.Hyperlinks.Delete
ActiveSheet.Hyperlinks.Add Anchor:=ref, Address:=TextBox39.Value
Range("C17:C1000").HorizontalAlignment = xlCenter
Range("C17:C1000").VerticalAlignment = xlCenter
End If
MsgBox "Vous venez de modifier un QMOS dans la base de données"
Response = MsgBox("Voulez vous modifier un autre QMOS ?", vbYesNo)
If Response = vbYes Then
ComboBox1 = ""
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
TextBox14.Text = ""
TextBox15.Text = ""
TextBox16.Text = ""
TextBox17.Text = ""
TextBox18.Text = ""
TextBox19.Text = ""
TextBox20.Text = ""
TextBox21.Text = ""
TextBox22.Text = ""
TextBox23.Text = ""
TextBox24.Text = ""
TextBox25.Text = ""
TextBox26.Text = ""
TextBox27.Text = ""
TextBox28.Text = ""
TextBox29.Text = ""
TextBox30.Text = ""
TextBox31.Text = ""
TextBox32.Text = ""
TextBox33.Text = ""
TextBox34.Text = ""
TextBox34.Text = ""
TextBox36.Text = ""
TextBox37.Text = ""
Else
Unload Me
End If
End If
End With
End Sub |
Partager