file name from a cell value in VB

S

spydor

I am writing in VB using macro to associate a graphic with a part number
located in a specific cell.

I need to return a graphic using the value of a cell.

IE: if the cell value is: CG234
Then Ineed to tell the macro to go to file:
C/documents.pictures.CG234.jpg

I can do the macro for locating the picture but can't figure out how to
get the cell value to become part of the file address where the graphic
is located.

Got any ideas on this???

Thanks for your consideration.........

Spydor
 
K

kraljb

try

Dim myFileName as String

myFileName = "c/documents.pictures." & range("A1").Value & ".jpg"

Hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top