MACRO to insert image in relation to the drop-down list

1

Good morning,

I have a question that I do not know if it is light or not:

I have a field (the large rectangle) of which I want to insert an image into it, depending on the drop-down list selected.

For example: When I select in the drop-down list (L11) "Ceu2", I want the rectangle to appear in "Ceu2" located in Q6. When you select Ceu, the same thing, but for the image in Q5.

However, in the same rectangle, when the person selects through cell L3 the 2nd drop-down list, with the options, stop appearing the images of the sky and appear which one to choose, either the "glasses" or the "train" .

Only then would be great. I was trying to do this using the INDEX and CORRESP functions but did not reach the character limit of the MATCH function kkk

If someone can lend a hand up there ... then I want X to last without a new option change from the drop down list, the image that appears in the rectangle is the "theme" contained in Q9

If I get confused I'll explain again, but at the beginning it was that. Thanks to anyone who can help =)

    
asked by anonymous 23.11.2018 / 11:43

2 answers

2

Solution without macro

Withinwhatyouhavealreadybuilt,whatyouneedtodoiscreatea[DefinedName]withformulaandthenlinkwiththecamera.Herearethesteps:

  • Loginto[NameManager]
  • Inthenamemanagercreateanewitem
  • Steps:
  • NAME>cImageScope>WorkbookComment>[branco]refersto:>=OFFSET($Q$4;MATCH($L$11;$P:$P;0)-1;0)Botão{OK}

    Adc.acameracomponent,toactivate:

  • File>Options
  • Followsteps1through5.Option6shouldopenforyou.
  • Fromhere,justselectthecellthatistheimage.Inyourcasethe$Q$5.andclickonthecamera.Notethattheimagewillrespecttherange/cellsize.Thentryadding.imagesofthesizeyouwanttouseandresizethecellandimageofthesamesize.

    Now when you select the camera that is nothing more than a dotted square, change the indent of formula to =cImage

        
    27.11.2018 / 22:21
    0

    You can use the cbxListSuspensa_change event so that each new change in your list of a macro was executed, and from that execution the image would change to the path of the image that is contained in the drop-down list.

    Sub cbxListaSuspensa_change()
    Dim caminho As String
    'Valor que está na lista suspensa
    caminho = cbxListaSuspensa.Value
    'Setar a imagem que deve ser colocada no espaço
    sheet1.Image1.Picture = LoadPicture(caminho)
    End Sub
    

        
    23.11.2018 / 12:40