Mac,
You provided me the code below for a project I was working on last week. I am trying to incorporate into this into this workbook and seems to work fine. After running this macro
I run the MikePics1 macro to insert the pics into the cells with the team names in them. Currently it will only insert the pics into Column B on each worksheet it is run on (these names are
manually entered). If I go into a worksheet and type the name over what was placed there by the copydata macro the pic will be entered.
I hope that is a bit clearer.
Option Explicit
Sub CopyData()
Dim r As Range, cel As Range, ws As Worksheet
Dim Rw&, Col&, Grp$, Nm$
On Error Resume Next
With Sheets("Activities")
Set r = Range(.Cells(2, 5), .Cells(Rows.Count, 5).End(xlUp))
End With
For Each cel In r
If Len(cel) > 3 Then
Grp = Replace(cel.Offset(, 1), "'", "")
Set ws = Worksheets(Grp)
Col = ws.Rows(1).Find(cel.Offset(, -3)).Column
Nm = Replace(cel.Offset(, 2), "'", "")
Rw = ws.Columns(2).Cells.Find(Nm, lookat:=xlWhole).Row
ws.Cells(Rw, Col).Value = cel.Value
'Ws.Cells(Rw, Col).Interior.ColorIndex = 8 ' Can be deleted
End If
Next cel
End Sub
Thanks again for your help,
Mike