Results 1 to 5 of 5

Return Closest Matching Filename - Macro

Threaded View

  1. #3
    Registered User
    Join Date
    11-16-2012
    Location
    Rhode Island, USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Return Closest Matching Filename - Macro

    Workbook is sensitive. Substitue attached.

    IF ITEM IS 4321GOLD, MACRO WILL RETURN IMAGE FILE 4321G.JPG AS OPPOSED TO 4321.JPG IF ITEM NOT FOUND
    IF ITEM IS JW005, MACRO WILL RETURN IMAGE FILE JW00.JPG AS OPPOSED TO JW006.JPG "
    IF ITEM IS 4321GOLD, MACRO WILL RETURN IMAGE FILE 4321WHITE.JPG (IF ITS THE NEXT CLOSEST MATCH).

    Sub PULLIMAGE()
    '
    ' PULLIMAGE Macro
    '
    Dim PICNAME As String
        PICNAME = Selection
        
    On Error GoTo ERRORHANDLER
    ActiveSheet.Pictures.Insert("\\NETWORK\F\ITEM IMAGES\" & PICNAME & ".JPG").Select
    
        Selection.ShapeRange.Height = 200
    
    
    Exit Sub
    
    ERRORHANDLER:
        MsgBox ("Item not found. Check item number.")
    
    '
    End Sub
    Quote Originally Posted by Leith Ross View Post
    Hello enidnunez,

    Please post your workbook and include more before and after examples. This will speed up developing a solution to your problem.

    To Post Your Workbook
    1. At the bottom right of the Reply window, Click the button Go Advanced
    2. At the top of the Your Message Window, in the first row of icons, Click the Paperclip icon.
    3. Click the Add Files button at the top right in the dialog box. This displays the File Manager dialog.
    4. Click the Select Files button at the bottom middle of the dialog.
    5. In the new window Find the file you want to upload, select it, and Click Open.
    6. You will now be back in the File Manager dialog. Click the bottom Middle button Upload File.
    7. Wait until the file has completely uploaded before you exit the File Manager dialog.

    File Manger Picture
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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