Optimisation et simplification de code
Bonjour,
pourriez vous m'aider à réduire ce code : il est fonctionnel mais compliqué pour la maintenance .
Private Sub TextBox999_Change()
Dim O As Worksheet
Dim R As Range
Dim LI As Long
Set O = Worksheets("Fiches Techniques Prépa")
Set R = O.Range("$B$6:B4006").Find(TextBox999.Value, , xlValues, xlWhole)
If Not R Is Nothing Then
LI = R.Row
TextBox41.Value = O.Cells(LI, 4).Value
TextBox42.Value = O.Cells(LI, 5).Value
TextBox43.Value = O.Cells(LI, 6).Value
TextBox44.Value = O.Cells(LI, 7).Value
TextBox45.Value = O.Cells(LI, 8).Value
TextBox46.Value = O.Cells(LI, 9).Value
TextBox47.Value = O.Cells(LI, 10).Value
TextBox48.Value = O.Cells(LI, 11).Value
TextBox49.Value = O.Cells(LI, 12).Value
TextBox50.Value = O.Cells(LI, 13).Value
TextBox51.Value = O.Cells(LI, 14).Value
TextBox52.Value = O.Cells(LI, 15).Value
TextBox53.Value = O.Cells(LI, 16).Value
TextBox54.Value = O.Cells(LI, 17).Value
TextBox55.Value = O.Cells(LI, 18).Value
TextBox56.Value = O.Cells(LI, 19).Value
TextBox57.Value = O.Cells(LI, 20).Value
TextBox58.Value = O.Cells(LI, 21).Value
TextBox59.Value = O.Cells(LI, 22).Value
TextBox60.Value = O.Cells(LI, 23).Value
TextBox61.Value = O.Cells(LI, 24).Value
TextBox62.Value = O.Cells(LI, 25).Value
TextBox63.Value = O.Cells(LI, 26).Value
TextBox64.Value = O.Cells(LI, 27).Value
TextBox27.Value = O.Cells(LI, 28).Value
TextBox28.Value = O.Cells(LI, 29).Value
TextBox29.Value = O.Cells(LI, 31).Value
TextBox30.Value = O.Cells(LI, 32).Value
TextBox1631.Value = O.Cells(LI, 33).Value
TextBox1633.Value = O.Cells(LI, 35).Value
TextBox31.Value = O.Cells(LI, 36).Value
TextBox32.Value = O.Cells(LI, 37).Value
TextBox33.Value = O.Cells(LI, 38).Value
TextBox34.Value = O.Cells(LI, 39).Value
TextBox35.Value = O.Cells(LI, 40).Value
TextBox36.Value = O.Cells(LI, 41).Value
TextBox37.Value = O.Cells(LI, 42).Value
TextBox38.Value = O.Cells(LI, 43).Value
TextBox39.Value = O.Cells(LI, 44).Value
TextBox40.Value = O.Cells(LI, 45).Value
TextBox1.Value = O.Cells(LI, 46).Value
TextBox2.Value = O.Cells(LI, 47).Value
TextBox3.Value = O.Cells(LI, 48).Value
TextBox4.Value = O.Cells(LI, 49).Value
TextBox5.Value = O.Cells(LI, 50).Value
TextBox6.Value = O.Cells(LI, 51).Value
TextBox7.Value = O.Cells(LI, 52).Value
TextBox8.Value = O.Cells(LI, 53).Value
TextBox9.Value = O.Cells(LI, 54).Value
TextBox10.Value = O.Cells(LI, 55).Value
TextBox11.Value = O.Cells(LI, 56).Value
TextBox12.Value = O.Cells(LI, 57).Value
TextBox13.Value = O.Cells(LI, 58).Value
TextBox14.Value = O.Cells(LI, 59).Value
TextBox15.Value = O.Cells(LI, 60).Value
TextBox16.Value = O.Cells(LI, 61).Value
TextBox17.Value = O.Cells(LI, 62).Value
TextBox18.Value = O.Cells(LI, 63).Value
TextBox19.Value = O.Cells(LI, 64).Value
TextBox20.Value = O.Cells(LI, 65).Value
TextBox21.Value = O.Cells(LI, 66).Value
TextBox22.Value = O.Cells(LI, 67).Value
TextBox23.Value = O.Cells(LI, 68).Value
TextBox24.Value = O.Cells(LI, 69).Value
TextBox1627.Value = O.Cells(LI, 72).Value
TextBox1630.Value = O.Cells(LI, 97).Value
TextBox1629.Value = O.Cells(LI, 100).Value
TextBox1815.Value = O.Cells(LI, 105).Value
TextBox1812.Value = O.Cells(LI, 106).Value
TextBox1811.Value = O.Cells(LI, 107).Value
TextBox25.Value = O.Cells(LI, 108).Value
TextBox26.Value = O.Cells(LI, 109).Value
TextBox1808.Value = O.Cells(LI, 110).Value
TextBox1819.Value = O.Cells(LI, 114).Value
TextBox1820.Value = O.Cells(LI, 115).Value
TextBox1818.Value = O.Cells(LI, 116).Value
TextBox1821.Value = O.Cells(LI, 117).Value
TextBox1817.Value = O.Cells(LI, 118).Value
End If
Set O = Nothing
Set R = Nothing
Dim O2 As Worksheet
Dim O10 As Worksheet
Dim R2 As Range
Dim R3 As Range
Dim R4 As Range
Dim R5 As Range
Dim R6 As Range
Dim R7 As Range
Dim R8 As Range
Dim R9 As Range
Dim R10 As Range
Dim R11 As Range
Dim R12 As Range
Dim R13 As Range
Dim R14 As Range
Dim R15 As Range
Dim R16 As Range
Dim R17 As Range
Dim R18 As Range
Dim R19 As Range
Dim R20 As Range
Dim R21 As Range
Dim R22 As Range
Dim R23 As Range
Dim R24 As Range
Dim R25 As Range
Dim R26 As Range
Dim R27 As Range
Dim R28 As Range
Dim R29 As Range
Dim R30 As Range
Dim R31 As Range
Dim R32 As Range
Dim R33 As Range
Dim R333 As Range
Dim R334 As Range
Dim R335 As Range
Dim LI2 As Long
Dim LI3 As Long
Dim LI4 As Long
Dim LI5 As Long
Dim LI6 As Long
Dim LI7 As Long
Dim LI8 As Long
Dim LI9 As Long
Dim LI10 As Long
Dim LI11 As Long
Dim LI12 As Long
Dim LI13 As Long
Dim LI14 As Long
Dim LI15 As Long
Dim LI16 As Long
Dim LI17 As Long
Dim LI18 As Long
Dim LI19 As Long
Dim LI20 As Long
Dim LI21 As Long
Dim LI22 As Long
Dim LI23 As Long
Dim LI24 As Long
Dim LI25 As Long
Dim LI26 As Long
Dim LI27 As Long
Dim LI28 As Long
Dim LI29 As Long
Dim LI30 As Long
Dim LI31 As Long
Dim LI32 As Long
Dim LI33 As Long
Dim LI333 As Long
Dim LI334 As Long
Dim LI335 As Long
Set O2 = Worksheets("Tarif")
Set O10 = Worksheets("Fiches Techniques Prépa")
Set R333 = O10.Range("$B$5:B4006").Find(TextBox999.Value, , xlValues, xlWhole)
If Not R333 Is Nothing Then
LI333 = R333.Row
ComboBox25.Value = O10.Cells(LI333, 105).Value
End If
Set R334 = O10.Range("$B$5:B4006").Find(TextBox999.Value, , xlValues, xlWhole)
If Not R334 Is Nothing Then
LI334 = R334.Row
ComboBox26.Value = O10.Cells(LI334, 106).Value
End If
Set R335 = O10.Range("$B$5:B4006").Find(TextBox999.Value, , xlValues, xlWhole)
If Not R335 Is Nothing Then
LI335 = R335.Row
ComboBox27.Value = O10.Cells(LI335, 107).Value
End If
Set R2 = O2.Range("$C$4:C3004").Find(TextBox41.Value, , xlValues, xlWhole)
If Not R2 Is Nothing Then
LI2 = R2.Row
ComboBox1.Value = O2.Cells(LI2, 4).Value
End If
Set R3 = O2.Range("$C$4:C3004").Find(TextBox42.Value, , xlValues, xlWhole)
If Not R3 Is Nothing Then
LI3 = R3.Row
ComboBox2.Value = O2.Cells(LI3, 4).Value
End If
Set R4 = O2.Range("$C$4:C3004").Find(TextBox43.Value, , xlValues, xlWhole)
If Not R4 Is Nothing Then
LI4 = R4.Row
ComboBox3.Value = O2.Cells(LI4, 4).Value
End If
Set R5 = O2.Range("$C$4:C3004").Find(TextBox44.Value, , xlValues, xlWhole)
If Not R5 Is Nothing Then
LI5 = R5.Row
ComboBox4.Value = O2.Cells(LI5, 4).Value
End If
Set R6 = O2.Range("$C$4:C3004").Find(TextBox45.Value, , xlValues, xlWhole)
If Not R6 Is Nothing Then
LI6 = R6.Row
ComboBox5.Value = O2.Cells(LI6, 4).Value
End If
Set R7 = O2.Range("$C$4:C3004").Find(TextBox46.Value, , xlValues, xlWhole)
If Not R7 Is Nothing Then
LI7 = R7.Row
ComboBox6.Value = O2.Cells(LI7, 4).Value
End If
Set R8 = O2.Range("$C$4:C3004").Find(TextBox47.Value, , xlValues, xlWhole)
If Not R8 Is Nothing Then
LI8 = R8.Row
ComboBox7.Value = O2.Cells(LI8, 4).Value
End If
Set R9 = O2.Range("$C$4:C3004").Find(TextBox48.Value, , xlValues, xlWhole)
If Not R9 Is Nothing Then
LI9 = R9.Row
ComboBox8.Value = O2.Cells(LI9, 4).Value
End If
Set R10 = O2.Range("$C$4:C3004").Find(TextBox49.Value, , xlValues, xlWhole)
If Not R10 Is Nothing Then
LI10 = R10.Row
ComboBox9.Value = O2.Cells(LI10, 4).Value
End If
Set R11 = O2.Range("$C$4:C3004").Find(TextBox50.Value, , xlValues, xlWhole)
If Not R11 Is Nothing Then
LI11 = R11.Row
ComboBox10.Value = O2.Cells(LI11, 4).Value
End If
Set R12 = O2.Range("$C$4:C3004").Find(TextBox51.Value, , xlValues, xlWhole)
If Not R12 Is Nothing Then
LI12 = R12.Row
ComboBox11.Value = O2.Cells(LI12, 4).Value
End If
Set R13 = O2.Range("$C$4:C3004").Find(TextBox52.Value, , xlValues, xlWhole)
If Not R13 Is Nothing Then
LI13 = R13.Row
ComboBox12.Value = O2.Cells(LI13, 4).Value
End If
Set R14 = O2.Range("$C$4:C3004").Find(TextBox53.Value, , xlValues, xlWhole)
If Not R14 Is Nothing Then
LI14 = R14.Row
ComboBox13.Value = O2.Cells(LI14, 4).Value
End If
Set R15 = O2.Range("$C$4:C3004").Find(TextBox54.Value, , xlValues, xlWhole)
If Not R15 Is Nothing Then
LI15 = R15.Row
ComboBox14.Value = O2.Cells(LI15, 4).Value
End If
Set R16 = O2.Range("$C$4:C3004").Find(TextBox55.Value, , xlValues, xlWhole)
If Not R16 Is Nothing Then
LI16 = R16.Row
ComboBox15.Value = O2.Cells(LI16, 4).Value
End If
Set R17 = O2.Range("$C$4:C3004").Find(TextBox56.Value, , xlValues, xlWhole)
If Not R17 Is Nothing Then
LI17 = R17.Row
ComboBox16.Value = O2.Cells(LI17, 4).Value
End If
Set R18 = O2.Range("$C$4:C3004").Find(TextBox57.Value, , xlValues, xlWhole)
If Not R18 Is Nothing Then
LI18 = R18.Row
ComboBox17.Value = O2.Cells(LI18, 4).Value
End If
Set R19 = O2.Range("$C$4:C3004").Find(TextBox58.Value, , xlValues, xlWhole)
If Not R19 Is Nothing Then
LI19 = R19.Row
ComboBox18.Value = O2.Cells(LI19, 4).Value
End If
Set R20 = O2.Range("$C$4:C3004").Find(TextBox59.Value, , xlValues, xlWhole)
If Not R20 Is Nothing Then
LI20 = R20.Row
ComboBox19.Value = O2.Cells(LI20, 4).Value
End If
Set R21 = O2.Range("$C$4:C3004").Find(TextBox60.Value, , xlValues, xlWhole)
If Not R21 Is Nothing Then
LI21 = R21.Row
ComboBox20.Value = O2.Cells(LI21, 4).Value
End If
Set R22 = O2.Range("$C$4:C3004").Find(TextBox61.Value, , xlValues, xlWhole)
If Not R22 Is Nothing Then
LI22 = R22.Row
ComboBox21.Value = O2.Cells(LI22, 4).Value
End If
Set R23 = O2.Range("$C$4:C3004").Find(TextBox62.Value, , xlValues, xlWhole)
If Not R23 Is Nothing Then
LI23 = R23.Row
ComboBox22.Value = O2.Cells(LI23, 4).Value
End If
Set R24 = O2.Range("$C$4:C3004").Find(TextBox63.Value, , xlValues, xlWhole)
If Not R24 Is Nothing Then
LI24 = R24.Row
ComboBox23.Value = O2.Cells(LI24, 4).Value
End If
Set R25 = O2.Range("$C$4:C3004").Find(TextBox64.Value, , xlValues, xlWhole)
If Not R25 Is Nothing Then
LI25 = R25.Row
ComboBox24.Value = O2.Cells(LI25, 4).Value
End If
Set O2 = Nothing
Set O10 = Nothing
Set R2 = Nothing
Set R3 = Nothing
Set R4 = Nothing
Set R5 = Nothing
Set R6 = Nothing
Set R7 = Nothing
Set R8 = Nothing
Set R9 = Nothing
Set R10 = Nothing
Set R11 = Nothing
Set R12 = Nothing
Set R13 = Nothing
Set R14 = Nothing
Set R15 = Nothing
Set R16 = Nothing
Set R17 = Nothing
Set R18 = Nothing
Set R19 = Nothing
Set R20 = Nothing
Set R21 = Nothing
Set R22 = Nothing
Set R23 = Nothing
Set R24 = Nothing
Set R25 = Nothing
Set R26 = Nothing
Set R27 = Nothing
Set R28 = Nothing
Set R29 = Nothing
Set R30 = Nothing
Set R31 = Nothing
Set R32 = Nothing
Set R33 = Nothing
Set R333 = Nothing
Set R334 = Nothing
Set R335 = Nothing
Dim O30 As Worksheet
Dim R36 As Range
Dim LI36 As Long
Set O30 = Worksheets("Fiches Techniques Assemblées")
Set R36 = O30.Range("$B$6:$B$4006").Find(TextBox999.Value, , xlValues, xlWhole)
If Not R36 Is Nothing Then
LI36 = R36.Row
'--------------------------------------------
TextBox1099.Value = O30.Cells(LI36, 27).Value
TextBox1100.Value = O30.Cells(LI36, 28).Value
TextBox1628.Value = O30.Cells(LI36, 71).Value
TextBox1800.Value = O30.Cells(LI36, 33).Value
TextBox1801.Value = O30.Cells(LI36, 34).Value
TextBox1802.Value = O30.Cells(LI36, 96).Value
TextBox1803.Value = O30.Cells(LI36, 30).Value
TextBox1804.Value = O30.Cells(LI36, 29).Value
TextBox1805.Value = O30.Cells(LI36, 32).Value
'------------------------------------------
TextBox30.Value = O30.Cells(LI36, 31).Value
'------------------------------------------
TextBox31.Value = O30.Cells(LI36, 35).Value
TextBox32.Value = O30.Cells(LI36, 36).Value
TextBox33.Value = O30.Cells(LI36, 37).Value
TextBox34.Value = O30.Cells(LI36, 38).Value
TextBox35.Value = O30.Cells(LI36, 39).Value
TextBox36.Value = O30.Cells(LI36, 40).Value
TextBox37.Value = O30.Cells(LI36, 41).Value
TextBox38.Value = O30.Cells(LI36, 42).Value
TextBox39.Value = O30.Cells(LI36, 43).Value
TextBox40.Value = O30.Cells(LI36, 44).Value
TextBox1817.Value = O30.Cells(LI36, 117).Value
TextBox1818.Value = O30.Cells(LI36, 115).Value
TextBox1819.Value = O30.Cells(LI36, 113).Value
TextBox1820.Value = O30.Cells(LI36, 114).Value
TextBox1821.Value = O30.Cells(LI36, 116).Value
'-------------------------------------------
TextBox1102.Value = O30.Cells(LI36, 3).Value
TextBox1103.Value = O30.Cells(LI36, 4).Value
TextBox1104.Value = O30.Cells(LI36, 5).Value
TextBox1105.Value = O30.Cells(LI36, 6).Value
TextBox1106.Value = O30.Cells(LI36, 7).Value
TextBox1107.Value = O30.Cells(LI36, 8).Value
TextBox1108.Value = O30.Cells(LI36, 9).Value
TextBox1109.Value = O30.Cells(LI36, 10).Value
TextBox1110.Value = O30.Cells(LI36, 11).Value
TextBox1111.Value = O30.Cells(LI36, 12).Value
TextBox1112.Value = O30.Cells(LI36, 13).Value
TextBox1113.Value = O30.Cells(LI36, 14).Value
TextBox1114.Value = O30.Cells(LI36, 15).Value
TextBox1115.Value = O30.Cells(LI36, 16).Value
TextBox1116.Value = O30.Cells(LI36, 17).Value
TextBox1117.Value = O30.Cells(LI36, 18).Value
'--------------------------------------------
TextBox1622.Value = O30.Cells(LI36, 19).Value
TextBox1623.Value = O30.Cells(LI36, 20).Value
TextBox1624.Value = O30.Cells(LI36, 21).Value
TextBox1625.Value = O30.Cells(LI36, 22).Value
TextBox1626.Value = O30.Cells(LI36, 23).Value
'--------------------------------------------
TextBox1125.Value = O30.Cells(LI36, 24).Value
TextBox1124.Value = O30.Cells(LI36, 25).Value
TextBox1123.Value = O30.Cells(LI36, 26).Value
'--------------------------------------------
TextBox1390.Value = O30.Cells(LI36, 45).Value
TextBox1391.Value = O30.Cells(LI36, 46).Value
TextBox1392.Value = O30.Cells(LI36, 47).Value
TextBox1393.Value = O30.Cells(LI36, 48).Value
TextBox1394.Value = O30.Cells(LI36, 49).Value
TextBox1395.Value = O30.Cells(LI36, 50).Value
TextBox1396.Value = O30.Cells(LI36, 51).Value
TextBox1397.Value = O30.Cells(LI36, 52).Value
TextBox1398.Value = O30.Cells(LI36, 53).Value
TextBox1399.Value = O30.Cells(LI36, 54).Value
TextBox1400.Value = O30.Cells(LI36, 55).Value
TextBox1401.Value = O30.Cells(LI36, 56).Value
TextBox1402.Value = O30.Cells(LI36, 57).Value
TextBox1403.Value = O30.Cells(LI36, 58).Value
TextBox1404.Value = O30.Cells(LI36, 59).Value
TextBox1405.Value = O30.Cells(LI36, 60).Value
'--------------------------------------------
TextBox1495.Value = O30.Cells(LI36, 61).Value
TextBox1496.Value = O30.Cells(LI36, 62).Value
TextBox1497.Value = O30.Cells(LI36, 63).Value
TextBox1498.Value = O30.Cells(LI36, 64).Value
TextBox1499.Value = O30.Cells(LI36, 65).Value
'--------------------------------------------
TextBox1500.Value = O30.Cells(LI36, 66).Value
TextBox1501.Value = O30.Cells(LI36, 67).Value
TextBox1502.Value = O30.Cells(LI36, 68).Value
'--------------------------------------------
End If
Set O30 = Nothing
Set R36 = Nothing
'--------------------------------------------------------
Dim O60 As Worksheet 'déclare la variable O (Onglet)
Dim O61 As Worksheet
Dim R60 As Range
Dim R61 As Range
Dim R62 As Range
Dim R63 As Range
Dim R64 As Range
Dim R65 As Range
Dim R66 As Range
Dim R67 As Range
Dim R68 As Range
Dim R69 As Range
Dim R70 As Range
Dim R71 As Range
Dim R72 As Range
Dim R73 As Range
Dim R74 As Range
Dim R75 As Range
Dim R76 As Range
Dim R77 As Range
Dim R78 As Range
Dim R79 As Range
Dim R80 As Range
Dim R81 As Range
Dim R82 As Range
Dim R83 As Range
'---------------------
Dim LI60 As Long
Dim LI61 As Long
Dim LI62 As Long
Dim LI63 As Long
Dim LI64 As Long
Dim LI65 As Long
Dim LI66 As Long
Dim LI67 As Long
Dim LI68 As Long
Dim LI69 As Long
Dim LI70 As Long
Dim LI71 As Long
Dim LI72 As Long
Dim LI73 As Long
Dim LI74 As Long
Dim LI75 As Long
Dim LI76 As Long
Dim LI77 As Long
Dim LI78 As Long
Dim LI79 As Long
Dim LI80 As Long
Dim LI81 As Long
Dim LI82 As Long
Dim LI83 As Long
'------------------------
Set O61 = Worksheets("Tarif")
Set O60 = Worksheets("Fiches Techniques Assemblées")
'---------------------------------------------------------------------------
Set R60 = O60.Range("$B$6:$B$4006").Find(TextBox999.Value, , xlValues, xlWhole)
If Not R60 Is Nothing Then
LI60 = R60.Row
ComboBox54.Value = O60.Cells(LI60, 3).Value
ComboBox55.Value = O60.Cells(LI60, 4).Value
ComboBox56.Value = O60.Cells(LI60, 5).Value
ComboBox57.Value = O60.Cells(LI60, 6).Value
ComboBox58.Value = O60.Cells(LI60, 7).Value
ComboBox59.Value = O60.Cells(LI60, 8).Value
ComboBox60.Value = O60.Cells(LI60, 9).Value
ComboBox61.Value = O60.Cells(LI60, 10).Value
ComboBox62.Value = O60.Cells(LI60, 11).Value
ComboBox63.Value = O60.Cells(LI60, 12).Value
ComboBox64.Value = O60.Cells(LI60, 13).Value
ComboBox65.Value = O60.Cells(LI60, 14).Value
ComboBox66.Value = O60.Cells(LI60, 15).Value
ComboBox67.Value = O60.Cells(LI60, 16).Value
ComboBox68.Value = O60.Cells(LI60, 17).Value
ComboBox69.Value = O60.Cells(LI60, 18).Value
End If
'-----------------------------------------------------------
Set R76 = O61.Range("C4:C3004").Find(TextBox1622.Value, , xlValues, xlWhole)
If Not R76 Is Nothing Then
LI76 = R76.Row
ComboBox70.Value = O61.Cells(LI76, 4).Value
End If
Set R77 = O61.Range("C4:C3004").Find(TextBox1623.Value, , xlValues, xlWhole)
If Not R77 Is Nothing Then
LI77 = R77.Row
ComboBox71.Value = O61.Cells(LI77, 4).Value
End If
Set R78 = O61.Range("C4:C3004").Find(TextBox1624.Value, , xlValues, xlWhole)
If Not R78 Is Nothing Then
LI78 = R78.Row
ComboBox72.Value = O61.Cells(LI78, 4).Value
End If
Set R79 = O61.Range("C4:C3004").Find(TextBox1625.Value, , xlValues, xlWhole)
If Not R79 Is Nothing Then
LI79 = R79.Row
ComboBox73.Value = O61.Cells(LI79, 4).Value
End If
Set R80 = O61.Range("C4:C3004").Find(TextBox1626.Value, , xlValues, xlWhole)
If Not R80 Is Nothing Then
LI80 = R80.Row
ComboBox74.Value = O61.Cells(LI80, 4).Value
End If
Set R81 = O61.Range("C4:C3004").Find(TextBox1125.Value, , xlValues, xlWhole)
If Not R81 Is Nothing Then
LI81 = R81.Row
ComboBox75.Value = O61.Cells(LI81, 4).Value
End If
Set R82 = O61.Range("C4:C3004").Find(TextBox1124.Value, , xlValues, xlWhole)
If Not R82 Is Nothing Then
LI82 = R82.Row
ComboBox76.Value = O61.Cells(LI82, 4).Value
End If
Set R83 = O61.Range("C4:C3004").Find(TextBox1123.Value, , xlValues, xlWhole)
If Not R83 Is Nothing Then
LI83 = R83.Row
ComboBox77.Value = O61.Cells(LI83, 4).Value
End If
Set O60 = Nothing
Set O61 = Nothing
Set R60 = Nothing
Set R61 = Nothing
Set R62 = Nothing
Set R63 = Nothing
Set R64 = Nothing
Set R65 = Nothing
Set R66 = Nothing
Set R67 = Nothing
Set R68 = Nothing
Set R69 = Nothing
Set R70 = Nothing
Set R71 = Nothing
Set R72 = Nothing
Set R73 = Nothing
Set R74 = Nothing
Set R75 = Nothing
Set R76 = Nothing
Set R77 = Nothing
Set R78 = Nothing
Set R79 = Nothing
Set R80 = Nothing
Set R81 = Nothing
Set R82 = Nothing
Set R82 = Nothing
End Sub
Salut Cyr89,
t'aider efficacement sans le fichier sera dur...
Quelques réflexions :
- donner à tes TextBox le même n° d'index que les n° de colonnes dans O2, O30
Ex : txtO2_1, txtO2_2... txtO30_50
Tu peux alors écrire une simple boucle en 3 lignes pour l'ensemble des valeurs.
Je vois cependant qu'il y a des coupures dans la suite des n° : voir le fichier pour imaginer une boucle efficace...
- pas besoin de déclarer autant de RANGE puisque chacune ne sert qu'une fois!
Dim rCel as Range et n'utiliser que rCel.
Là aussi, je devine une possibilité de boucle mais, sans fichier, sans connaître le contexte, ça va être galère pour nous!
A+