1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Sub display_pics()
ActiveSheet.Shapes.Range("pic_1").Delete
dirpic = "C:\Users\BIF\Documents\PrintScreens\"
b = 0
maxpics = 61
Do While b > maxpics Or b = 0
b = Int(Rnd() * 100)
Loop
If Len(b) = 1 Then b = "0" & b
picfile = "Screenshot0" & b & ".jpg"
Cells(1, 1).Select
ActiveSheet.Pictures.Insert(dirpic & picfile).Select
Selection.ShapeRange.Height = 56.6929133858
Selection.ShapeRange.Width = 56.6929133858
Selection.ShapeRange.Name = "pic_1"
Selection.OnAction = "display_pics"
Range("A1").Select
End Sub |
Partager