Guest User

Untitled

a guest
Mar 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Private Sub CommandButton1_Click()
  2.  
  3. Application.ScreenUpdating = False
  4.  
  5. Dim strPic As String
  6.  
  7. On Error Resume Next
  8.  
  9. Dim cRange As Integer
  10. strPic = "M:FTP ImagesQuotesheet Images GIF"
  11.  
  12. cRange = (Range("I8").End(xlDown).Row) - 8
  13. Range("I8").Select
  14.  
  15. For i = 0 To cRange
  16. With ActiveCell
  17. pic_file = strPic & .Value & ".gif"
  18.  
  19. If Dir(pic_file) <> vbNullString Then
  20. Set pict1 = ActiveSheet.Pictures.Insert(pic_file)
  21.  
  22. .AddComment
  23. .Comment.Shape.Fill.UserPicture strPic & .Value & ".gif"
  24. .Comment.Shape.Height = pict1.Height
  25. .Comment.Shape.Width = pict1.Width
  26. .Comment.Visible = False
  27.  
  28. .Value = "Hover For Image"
  29. .Offset(1, 0).Select
  30.  
  31. pict1.Delete
  32. Set pict1 = Nothing
  33. Else
  34. .Value = "Image Unavailable"
  35. .Offset(1, 0).Select
  36. End If
  37.  
  38. End With
  39. Next
  40.  
  41. Application.ScreenUpdating = True
  42.  
  43. End Sub
Add Comment
Please, Sign In to add comment