GerryZ
Well-known Member
- Joined
- Jul 4, 2014
- Messages
- 1,224
- Office Version
- 365
- Platform
- Windows
Hello Vba Friends, Im Learning VBA, I' have a code that works fine but only one problem:
I need that in range C2:C16 all images will be allign correctly in the center of the cells
Thank you for your help
I need that in range C2:C16 all images will be allign correctly in the center of the cells
VBA Code:
Option Explicit
Sub InserisciLaFaccina()
Dim cella As Range
Dim Faccina As Shape
For Each Faccina In Foglio1.Shapes
If Faccina.Name <> "Immagine1" _
And Faccina.Name <> "Immagine2" _
And Faccina.Name <> "Immagine3" _
And Faccina.Name <> "Immagine4" Then
Faccina.Delete
End If
Next
For Each cella In Range("B2:B16")
If cella.Value < 6 Then
Foglio1.Shapes("Immagine3").Copy
cella.Offset(0, 1).PasteSpecial
ElseIf cella.Value >= 6 And cella.Value < 8 Then
Foglio1.Shapes("Immagine2").Copy
cella.Offset(0, 1).PasteSpecial
Else
Foglio1.Shapes("Immagine1").Copy
cella.Offset(0, 1).PasteSpecial
End If
Next cella
End Sub
Thank you for your help