Modifica la tua Sub CentraPulsant come segue:
- Codice: Seleziona tutto
Sub DuplicaEtCentraPulsanti()
Dim Shp As Shape
'----------------
' luglio 23 da pc-facile Anthony
' serve a duplicare e allineare i pulsantini in col C al centro delle celle
' http://www.pc-facile.com/forum/viewtopic.php?f=26&t=113041&p=664639&sid=511c36e58a902e069f48ca91d1fbed38#p664639
'-----------------------
Dim RemArea As String, taShp As Shape, myC As Range
RemArea = "C9:C100"
'
'Rimuovi Shapes dalle celle di destinazione:
For Each Shp In ActiveSheet.Shapes
If Shp.Type = msoPicture Then
If Not Application.Intersect(Range(RemArea), Shp.TopLeftCell) Is Nothing Then
Shp.Delete
Else
If Shp.TopLeftCell.Address = "$C$8" Then
Set taShp = Shp
End If
End If
End If
Next Shp
'Copia e aggiungi:
taShp.Copy
DoEvents
For Each myC In Range(RemArea)
DoEvents
myC.PasteSpecial xlPasteAll
Next myC
'Centra nella cella
For Each Shp In ActiveSheet.Shapes
' Debug.Print Shp.Type, Shp.Name, Shp.TopLeftCell.Address(0, 0)
If Shp.Type = msoPicture Then
If Shp.TopLeftCell.Column = 3 And Shp.TopLeftCell.Row >= 8 Then ' 3=col C 'vedi nota**
Shp.Top = Shp.TopLeftCell.Top + (Shp.TopLeftCell.Height - Shp.Height) / 2
Shp.Left = Shp.TopLeftCell.Left + (Shp.TopLeftCell.Width - Shp.Width) / 2
End If
End If
Next Shp
Range("C8").Select
End Sub
Noterai le modifiche per eliminare eventuali forme dalle celle destinatarie, copiarvi la cella campione, e infine allinearle col codice preesistente