Excel/Vlook up macro to return pictures
QUESTION: I have a list of part numbers in sheet 1 column A and corresponding photos for each part number in column F. Now I have a list of part numbers in sheet 2 and I want to apply Vlookup funtion in sheet2 and if that part number exist in sheet 2 photo of that part should come in sheet 2 column B. Please help me by telling how can I do this.
ANSWER: VLOOKUP (or any function) returns a VALUE, not a picture
So if it's a macro, something needs to invoke the macro. If it's a button, it'd depend on the location of the active cell or a prompt to select the active cell. All the macro would do is look for the part number and copy the picture from column F. But that seems a little overkill since that process could be done manually (unless you're talking about hundreds of part numbers).
Tell me how you'd like to proceed.
---------- FOLLOW-UP ----------
QUESTION: I want to do it for thousand of pictures
Run this with Sheet2 active:
On Error Resume Next
Dim n As Integer
For i = 1 To Range("A60000").End(xlUp).Row
n = 0
n = Application.Match(Cells(i, 1).Value, Sheets("Sheet1").Range("A:A"), 0)
If n > 0 Then
Sheets("Sheet1").Cells(n, 6).CopyPicture Appearance:=xlScreen, Format:=xlPicture
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here