I can't delete a Shape in VBA
Good morning
in an Excel sheet I create a Shape, an arrow, which serves to signal a row,
As you can see from the image I click a button (Mark Article etc ..) and create an arrow, where it is drawn, which signals the clicked button, and so far so good. When I click on the button in the bottom row, I want to delete the existing arrow to recreate it in the row next to the button. I can't delete it because I can't find it, it's like it doesn't exist. I also attach the sub that creates the arrow shape:
Sub insertArrow(ByVal rng As Range)
Dim sh As Worksheet, s As Shape
Dim leftP As Double, topP As Double, W As Double, H As Double
'Cancella la freccia su riga di sopra
DeleteShape2 'Qui la sub dove dovrebbe cancellare la Shape
'Nome Sheet
Set sh = rng.Parent
'set la freccia larghezza and altezza (si puo cambiare)
W = 20: H = 15
leftP = rng.Left '+ rng.Width - W - 1 'calculate the horiz position
topP = rng.Top + (rng.Height - H) / 2 'calculate the vert position
Set s = sh.Shapes.AddShape(34, leftP, topP, W, H)
s.Name = s.Name
s.LockAspectRatio = msoTrue: s.Placement = xlMoveAndSize
End Sub
If someone can please give me a tip.
Thank you very much
Fabrizio