SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub SquirrelDraw()
  2.  
  3. Dim i As Integer
  4. Dim sFilename As String
  5. Dim bcontinue As Boolean
  6. Dim spath As String
  7.  
  8. spath = "X:\Josh_Placards\Pic_Dump\J5\rack_1"
  9. i = 1
  10. bcontinue = True
  11.  
  12.  
  13. While bcontinue = True
  14.  sFilename = Worksheets(2).Cells(i, 1).Value
  15.  Worksheets(2).Cells(i, 5) = sFilename
  16.  If sFilename = "" Then
  17.  bcontinue = False
  18. Else
  19.  Cells(i, 2).Select
  20.  ActiveSheet.Pictures.Insert(spath + sFilename).Select
  21.  Selection.ShapeRange.LockAspectRatio = msoFalse
  22.  Selection.ShapeRange.Height = 141.75
  23.  Selection.ShapeRange.Width = 141.75
  24.  i = i + 1
  25. End If
  26. Wend
  27.  
  28. 'indicates loop is finished
  29. Worksheets(2).Cells(4, 4) = "success"
  30.  
  31. End Sub
  32.  
  33. 'just tests that images can be loaded based on a parameter. Works.
  34. Sub imagetest()
  35.  ActiveSheet.Pictures.Insert ("X:\Josh_Placards\Pic_Dump\J5\rack_1\" & Range("e16").Select & ".jpg")
  36. End Sub
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top