Gruppe
Grafik
Problem
Die Grafik soll auf Schaltflächendruck ein/ausgeblendet bzw. verschoben werden.
StandardModule: Modul1
Sub MoveGrafik()
Dim pct As Picture
Dim iRow As Integer, iCol As Integer
Set pct = ActiveSheet.Pictures(1)
iRow = pct.TopLeftCell.Row
iCol = pct.TopLeftCell.Column
If iCol = 4 Then
iCol = 1
iRow = iRow + 1
If iRow = 6 Then iRow = 1
Else
iCol = iCol + 1
pct.Left = Cells(iRow, iCol).Left
Exit Sub
End If
pct.Left = Cells(iRow, iCol).Left
pct.Top = Cells(iRow, iCol).Top
End Sub
Sub VisibleGrafik()
Dim pct As Picture
Set pct = ActiveSheet.Pictures(1)
pct.Visible = Not pct.Visible
End Sub