thole
05-08-2009, 09:18 AM
I have a workbook with blue-tabbed wkshts and red-tabbed wkshts.
I would like to cycle through the red-tabbed worksheets, and if the value of Range AH is the same as the name of one of the blue-tabbed worksheets, import the shape named "linedrawing" from that worksheet.
Repeat until done.
All the blue-tabbed worksheets have the exact same formatting, the shape is actually a picture, and it has the same position and same name in all the different blue-tabbed sheets.
What I have so far (which absolutely is off in another galaxy) is:
Sub CopyDrawings()
Dim shp As Shape
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
'If ws.Tab.ColorIndex = 3 Then
ws.Activate
For Each c In ActiveSheet.Range("$AH$50:$AH$2000")
If c.Value = ws.Name Then
ws.shp("linedrawing").Select
Selection.Copy
c.Offset(rowOffset:=0, columnOffset:=-31).Select
ActiveSheet.Paste
MsgBox "OK?"
End If
Next
End If
Next
End Sub
I know i am not selecting things properly.
I had posted it on another site, got no help, closed it down.
I would like to cycle through the red-tabbed worksheets, and if the value of Range AH is the same as the name of one of the blue-tabbed worksheets, import the shape named "linedrawing" from that worksheet.
Repeat until done.
All the blue-tabbed worksheets have the exact same formatting, the shape is actually a picture, and it has the same position and same name in all the different blue-tabbed sheets.
What I have so far (which absolutely is off in another galaxy) is:
Sub CopyDrawings()
Dim shp As Shape
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
'If ws.Tab.ColorIndex = 3 Then
ws.Activate
For Each c In ActiveSheet.Range("$AH$50:$AH$2000")
If c.Value = ws.Name Then
ws.shp("linedrawing").Select
Selection.Copy
c.Offset(rowOffset:=0, columnOffset:=-31).Select
ActiveSheet.Paste
MsgBox "OK?"
End If
Next
End If
Next
End Sub
I know i am not selecting things properly.
I had posted it on another site, got no help, closed it down.