Results 1 to 9 of 9

Insert Picture(S) based on dropdown validation list

Threaded View

  1. #1
    Registered User
    Join Date
    04-21-2018
    Location
    Leeds
    MS-Off Ver
    365
    Posts
    24

    Insert Picture(S) based on dropdown validation list

    Hello everyone,

    I am new to VBA!

    Any help will be greatly appreciated.

    I have a sheet named NCR Form, in cell A9 i have a dropdown data validation list, when i pick from the data validation list pre-determined cells are automatically populated, also within this sheet are 6 picture boxes,

    What i want from these 6 picture boxes is when i pick from the Data Validation List the picture boxes automatically populate, the pictures can vary from 1 to 6.

    I can do this now using a control button with the following code that i have managed to get from this wonderful site, however I have to have 6 pictures for each one in the list

    Sub ReplaceImages()
        If Range("A9") = "" Then Exit Sub
        Dim MyPic As String
        For i = 1 To 6
            MyPic = "C:\Output\" & Range("A9").Value & "_" & i & ".jpg"
            With Me.Shapes("Pic_" & i).Fill
                .Visible = msoTrue
                On Error Resume Next
                .UserPicture MyPic
            End With
        Next i
    End Sub
    
    Private Sub CommandButton1_Click()
                ReplaceImages
    End Sub

    The picture boxes are named Pic_1 to Pic_6
    The pictures are located in C:\Output\ and are named NCR 00001_1, NCR 00001_2 etc

    What i desire is to get rid of the command button and have the code that will automatically populate the picture boxes using the Dropdown Data Validation List, the number of pictures will vary from 1 to 6, and have them the same size.

    Any help will be greatly appreciated!

    Thank You

    Rob
    Last edited by Rob1970; 04-23-2018 at 04:33 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-25-2017, 09:57 PM
  2. Cross Reference (Vlookup) based on Data Validation List Dropdown
    By eguirocker3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2014, 05:02 PM
  3. Select Picture via Dropdown list
    By cmlucifer in forum Excel General
    Replies: 6
    Last Post: 01-21-2014, 02:51 PM
  4. Want to make a Calender with Dropdown List Events(picture) for each Day
    By pietersc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2012, 02:13 PM
  5. Replies: 0
    Last Post: 08-22-2012, 03:52 PM
  6. [SOLVED] macro: insert picture based on workbook location, not picture root path.
    By NicksDad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2012, 07:47 AM
  7. [SOLVED] Insert Picture from dropdown selection
    By Mike at Channel in forum Excel - New Users/Basics
    Replies: 21
    Last Post: 03-21-2006, 09:15 PM

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