Hide or View images in multiple columns based on multiple cells

2k05gt

Board Regular
Joined
Sep 1, 2006
Messages
157
I found code that will allow for 2 images to show / hide based on cells value,
But I have 10 columns and each column has 5 images (Icons).PNG

Each Column has 5 icons, one is visible on each column by default Thats "IMGA1"
There are 5 Categories for each Column
Helper -ImgX1
Apprentice -ImgX2
Journeyman -ImgX3
Master -ImgX4
Inspector -ImgX5

Columns are for Each Trade.. Each Trade has a different Logo for each Level of License.

So....
If A2 Value = "Journeyman" then show "ImgA3"
If B2 Value = "Master" then show "ImgB4"

Electrical Plumbing HVAC ...
A2 B2 C2 D2 E2 F2 G2 H2 I2 J2
ImgA1 ImgB1___
ImgA2 ImgB2___
ImgA3 ImgB3___
ImgA4 ImgB4___
ImgA5 ImgB5___

I tried to do a Case Else code but it got to confusing

Code:
Select Case Range("A2").Value

Case Is = "Helper"
Set Pic1 = Sheets("Sheet2").Shapes("ImgA1").Show
Else
This was going to be a lot of lines

then I also Tried
Code:
    Private Sub Worksheet_Calculate()
        Dim oPic As Picture
        Elect.Pictures.Visible = False
        Pictures("Picture 3").Visible = True 
        With Range("A2")  
            For Each oPic In Elect.Pictures
                If oPic.Name = .Text Then
                    oPic.Visible = True
                    oPic.Top = .Top
                    oPic.Left = .Left
                    Exit For
                End If
            Next oPic
        End With
    End Sub

I realised this was going to be to complex, and Ideas ??
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
So I figured out a way using Dynamic Images and named ranges.
If anyone else needs to do this, this is what I did.

With the images on a separate sheet I used

5 Rows Column A1-A5 I put the name of the level
A1=Helper
A2=Apprentice
A3=Journeyman
A4=Master
A5=Inspector

In Column B1-B5
I put the Image in each cell, Copied the Cell the Pasted it as a Linked Image

I then created a named range ElecLogoLookUp and put this formula in to the named range =INDEX(Vars!K$3:L$7,MATCH(License!L$2,Vars!K$3:K$7,0),2)
If the Cell L2 in worksheet License type was mater the the log would show up

Anywhere I wanted the Logo to show up I would paste the Link Image object and change the Named range =ElecLogoLookUp

I did this for all the other trades and it's working great.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top