+ Reply to Thread
Results 1 to 3 of 3

file name from a cell value in VB

  1. #1
    Registered User
    Join Date
    10-29-2005
    Posts
    16

    file name from a cell value in VB

    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

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    try

    Dim myFileName as String

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

    Hope that helps

  3. #3
    CLR
    Guest

    RE: file name from a cell value in VB

    "C:\Directory\Pictures\" & Range("A1").value

    hth
    Vaya con Dios,
    Chuck, CABGx3





    "spydor" wrote:

    >
    > 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
    >
    >
    > --
    > spydor
    > ------------------------------------------------------------------------
    > spydor's Profile: http://www.excelforum.com/member.php...o&userid=28438
    > View this thread: http://www.excelforum.com/showthread...hreadid=516263
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1