Moderatori: Anthony47, Flash30005
Sub CentraPulsanti()
Dim Shp As Shape
'
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 '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
End Sub
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
Sub CentraPulsanti()
Dim Shp As Shape
'----------------
' luglio 23 da pc-facile entony
' serve ad allineare i pulsantini in col G al centro delle celle
' http://www.pc-facile.com/forum/viewtopic.php?f=26&t=113041&p=664639&sid=511c36e58a902e069f48ca91d1fbed38#p664639
'
' centra i pulsanti di col G
'-----------------------
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 = 7 And Shp.TopLeftCell.Row >= 8 Then ' 7=col G '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
End Sub
For Each Shp In ActiveSheet.Shapes
If Shp.Type = msoPicture Then
If Shp.TopLeftCell.Row = 4 Then
If Shp.Height < Range("A4").Height Then ' **Vedi testo
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
End If
Next Shp
Questo presuppone che le immagini di cui parliamo giacciano già su riga 4; non controllo che le colonne siano G:N dando per scontato che non ci siano altre immagini su riga 4 che invece vorresti lasciare immutate; se ho assunto male allora lo aggiungiamo.
Torna a Applicazioni Office Windows
Inserimento parziale valore cella in MessageBox Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 6 |
Aggiornare cella con somma quando aggiungo nuova colonna Autore: marcopont |
Forum: Applicazioni Office Windows Risposte: 1 |
Aumenta altezza riga in base valore cella Autore: trittico69 |
Forum: Applicazioni Office Windows Risposte: 47 |
Importare immagini a seconda del testo in una cella Autore: Paolo67met |
Forum: Applicazioni Office Windows Risposte: 4 |
Inserire valore di una cella in altra cella con testo Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 17 |
Visitano il forum: Nessuno e 24 ospiti