✔ 最佳答案
圖片參考:
http://hk.yimg.com/i/icon/16/1.gif
下面是一個例子:
Return "no Picture Found" If There Is Not One Avaliable
Sub Copy_Cells()
'Copying the row
addr = ActiveSheet.Shapes(Application.Caller).TopLeftCell.Address
Intersect(Range(addr).EntireRow, Range("b:ak")).Select
Selection.Copy Sheet2.Range("b65536").End(xlUp).Offset(0, 0)
Sheets("sheet3").Select
'Picture code
MyPicturesName = Sheets("sheet3").Range("i5").Text
'Allow "no picture found" error
On Error Resume Next
Sheets("sheet1").Shapes(MyPicturesName).Copy
Sheets("sheet3").Range("c3").Select
'Check if error
If Err <> 0 Then
'Was error
ActiveCell = "Sorry no picture found."
'Reset Err
Err = 0
Else
'Picture found
ActiveSheet.Paste
End If
Range("a1").Select
'hide tabs
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Visible = False
End Sub