Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using a cell value as graphic file address


The problem is thusly:

In a list of part numbers located in cells, I need to write a VB macro
to use that part number to bring up the graphic image associated with
that number.

IE: Cell value is: DR3456

Macro will take this value and find a graphic file:

C:/documents.pictures.jpeg
or somthing similar. I am locating the parts and associated part
numbers from a drop down list in Excel. Maybe there is another simple
solution to assoicate the graph with the part number.......

Dis Boy is Puzzzled......

Thanks,
Spydor


--
spydor
------------------------------------------------------------------------
spydor's Profile: http://www.excelforum.com/member.php...o&userid=28438
View this thread: http://www.excelforum.com/showthread...hreadid=516334

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default using a cell value as graphic file address

http://www.mcgimpsey.com/excel/lookuppics.html
JE McGimpsey's site

--
Regards,
Tom Ogilvy

"spydor" wrote in
message ...

The problem is thusly:

In a list of part numbers located in cells, I need to write a VB macro
to use that part number to bring up the graphic image associated with
that number.

IE: Cell value is: DR3456

Macro will take this value and find a graphic file:

C:/documents.pictures.jpeg
or somthing similar. I am locating the parts and associated part
numbers from a drop down list in Excel. Maybe there is another simple
solution to assoicate the graph with the part number.......

Dis Boy is Puzzzled......

Thanks,
Spydor


--
spydor
------------------------------------------------------------------------
spydor's Profile:

http://www.excelforum.com/member.php...o&userid=28438
View this thread: http://www.excelforum.com/showthread...hreadid=516334



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using a cell value as graphic file address

I'm trying to help but I don't really understand your question.

Is DR3456 the name of the picture you want to open or the Part Number?
Are they different or are they the same?

I don't understand this part: "I am locating the parts and associated
part numbers from a drop down list in Excel." Does this mean that you
have a list of part numbers in a range and the combobox, or whatever,
is showing those numbers?
If thats the case then you can use the value of the selected item,
which I'm assuming is the part number, in the drop-down list in a
VLookupFunction, and return the picture name. Then can open up the
picture.

Here a sub that will insert pictures onto your worksheet.
The name of the pictures are found in Cells "A1:A6"

Public Sub InsertPicture()
Dim pictureName As String
Dim fileName As String
Dim cell As Range
For Each cell In Worksheets("Sheet1").Range("A1:A6")
pictureName = cell.Value
fileName = "C:\Program Files\Pictures\" & cell.Value & ".jpg"
Worksheets("Sheet1").Pictures.Insert(fileName).Sel ect
Next cell
End Sub

If I didn't help you too well, explain in more detail what you mean.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open file from address in a cell David P. Excel Discussion (Misc queries) 1 December 18th 07 03:01 PM
How can I link a pdf file (address) to an Excel cell Wil Excel Discussion (Misc queries) 1 April 28th 06 10:38 AM
insert file address to open graphic kbs93726 Excel Discussion (Misc queries) 1 February 28th 06 06:11 PM
Creating links to graphic file YBoyd Excel Discussion (Misc queries) 1 February 8th 06 01:55 AM
Saving a Worksheet Shape as a Graphic File ! RAFAAJ2000[_2_] Excel Programming 3 May 21st 05 12:30 AM


All times are GMT +1. The time now is 01:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"