Hi all.

I'm using some code I found (here - http://en.kioskea.net/faq/14170-exce...in-a-worksheet) to resize and paste images from a directory into a range of cells in a worksheet. This unedited code works perfectly in pasting images into column 'A' in from the image name in column B (my file is a classroom seating plan).

I would dearly like to be able to use the code to lookup into column AR2:AR31 for each filename and then paste each image in order into the cells (E33,E29,E25,E21,E17,E13,E9,I9,D3,H3,L3,P3,T3,X3,S9,W9,W13,W17,W21,W25,W29,W33,P27,P23,P19,L19,L23,L27) - so that they match the correct child. These cells could perhaps be in column AQ2:AQ31 and be referenced in the code?

I am a complete noob when it comes to VBA and have next to no clue what to do so any help would be hugely appreciated!
Thanks in anticipation.

Code below:

Sub Picture()
Dim picname As String

Dim pasteAt As Integer
Dim lThisRow As Long

lThisRow = 2

Do While (Cells(lThisRow, 2) <> "")


pasteAt = lThisRow
Cells(pasteAt, 1).Select 'This is where picture will be inserted


picname = Cells(lThisRow, 2) 'This is the picture name

present = Dir("T:\SIMS\Photos\New Folder\6012\" & picname & ".bmp")

If present <> "" Then

ActiveSheet.Pictures.Insert("T:\SIMS\Photos\New Folder\6012\" & picname & ".bmp").Select 'Path to where pictures are stored
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This resizes the picture
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
With Selection
'.Left = Range("A6").Left
'.Top = Range("A6").Top
.Left = Cells(pasteAt, 1).Left
.Top = Cells(pasteAt, 1).Top

.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.Height = 40#
.ShapeRange.Width = 40#
.ShapeRange.Rotation = 0#
End With



Else
Cells(pasteAt, 1) = "No Picture Found"
End If

lThisRow = lThisRow + 1
Loop

Range("A10").Select
Application.ScreenUpdating = True

Exit Sub

ErrNoPhoto:
MsgBox "Unable to Find Photo" 'Shows message box if picture not found
Exit Sub
Range("B20").Select

End Sub