Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

effacer forme auto

1 réponse
Avatar
fredbzr
Bonjour à tous
j'ai besoin d'un coup de main pour un problème dont je n'arrive pas à bout.
Lorsque je clique sur un bouton, des cellules se colorient et des formes
automatiques carrées dans lesquelles je mets des chiffres qui me servent de
repérages apparaissent au dessus,dessous...des cellules.
j'arrive à effacer les cellules coloriées mais pas les formes automatiques,
à chaque fois j'ai un message d'erreur comme quoi il ne trouve pas l'objet
avez vous une solution
merci de votre aide

Private Sub CommandButton2_Click()

Range("A4:E7").Select
Selection.Interior.ColorIndex = xlNone

Range("A7,B5,C6,D7,E4").Select

With Selection.Interior
.ColorIndex = 5
.Pattern = xlSolid

Range("A1").Activate
End With

ActiveSheet.Shapes.AddShape(msoShapeRectangle, 12#, 60#, 21.75, 15.75). _
Select
Selection.Characters.Text = "1"
With Selection.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 80.25, 71.25, 24.75,
22.5). _
Select
Selection.Characters.Text = "2"
With Selection.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 138.75, 42#, 24.75,
18.75). _
Select
Selection.Characters.Text = "3"
With Selection.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("a1").Select

End Sub

Bouton efface
Private Sub CommandButton3_Click()

Range("A4:E7").Select
Selection.Interior.ColorIndex = xlNone

Range("A1").Activate

End Sub

--


Katia , Fred & Valentin

1 réponse

Avatar
marcel
Private Sub CommandButton3_Click()
ActiveSheet.DrawingObjects.Delete
end sub