Bonjour,
Après plusieurs essais, je ne trouve pas la solution.
Dans mon fichier excel, il y a une colonne "tests" et un ligne avec des nombres, mon but est d'insérer un rectangle en fonction du test qui vient d'etre rentré et de l'intervalle des nombres
Sub Macro1()
Dim Cel As Range
Dim x As Integer
nom = InputBox("Saisir un test", "saisi")
nb1 = InputBox("Saisir début de l'intervalle", "saisi")
nb2 = InputBox("Saisir la fin de l'intervalle", "saisi")
x = 6
For Each Cel In Range("C4:C10")
If Cel.Value = "" Then
Cel.Value = nom
Exit For
End If
x = x + 1
Next Cel
Dim y As Integer
For Each Cel In Range("D3:H3")
y = y + 1
If Cel.Value = nb Then
Exit For
End If
Next Cel
'
With Cells(x, y)
ActiveSheet.Shapes.AddShape(msoShapeFlowchartTerminator, y, y, 50, 15).Select
End With
End Sub
Mon soucis est qu'il s'insère en haut à gauche de la feuille