...152...


Zufalls-Grafik
Es sind 6 Grafiken vorhanden.
Diese sollen nach dem Zufalls-Prinzip angezeigt werden
Sub Zufalls_Grafiken()
On Error GoTo Errorhandler
Dim i As Byte
Dim x As Byte

  ' Alle Grafiken ausblenden
  For i = 1 To ActiveSheet.Shapes.Count
      ActiveSheet.Shapes(i).Visible = False
  Next i

  [A1].FormulaR1C1 = "=ROUND(RAND()*5,0)+1"
  x = [A1].Value
  ActiveSheet.Shapes(x).Visible = True
Errorhandler:
  MsgBox "Es sind nicht 6 Grafiken im Tabellenblatt vorhanden"
End Sub

by Monika Weber

 

Thread:

http://forum.myphorum.de/read.php?f=3040&i=3684&t=3684