Please help.
I am attempting to hide a picture (Picture1) if cell D3 = "Monday".
Please help.
I am attempting to hide a picture (Picture1) if cell D3 = "Monday".
Please Login or Register to view this content.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
I can't seem to get that to work. The picture is named "TELE" in the name box so I amended the code to:
With ActiveSheet
If .Range("D3").Value = "Monday" Then
.Shapes("TELE").Visible = False
Else
.Shapes("TELE").Visible = True
End If
End With
Thanks so much for helping by the way. Hugely appreciated.
I can't seem to get that to work. The picture is named "TELE" in the name box so I amended the code to:
With ActiveSheet
If .Range("D3").Value = "Monday" Then
.Shapes("TELE").Visible = False
Else
.Shapes("TELE").Visible = True
End If
End With
Thanks so much for helping by the way. Hugely appreciated.
A crude version of the document attached.
A crude version of the document is attached.
Works for me. You will have to explain what is happening.
Did you put the code in a sub in a module?
If you want something done right... find a forum and ask an online expert.
Time flies like an arrow. Fruit flies like a banana.
Simply copy and pasted the code via the view code function on the appropriate tab.
I'm a beginner at all this.
The code worked for me using your example workbook.
- Alt+F11 to open the VBA editor
- Select Insert\Module from the VBA menu.
- Paste the code from below in the edit window.
- Run Macro1
Please Login or Register to view this content.
Last edited by AlphaFrog; 06-26-2017 at 10:46 PM.
Snip attached fyi
AMAZING!!!
Thank you so much. Apologies for the frustrating noviceness!
All, Sorry me again.
Would it be possible to extend this code for multiple days and multiple images?
eg:
If .Range("D3").Value = "Monday" Then
.Shapes("PIC1").Visible = False
.Shapes("PIC2").Visible = False
.Shapes("PIC3").Visible = False
.Shapes("PIC4").Visible = False
.Shapes("PIC5").Visible = False
If .Range("D3").Value = "Tuesday" Then
.Shapes("PIC1").Visible = False
.Shapes("PIC2").Visible = False
.Shapes("PIC3").Visible = True
.Shapes("PIC4").Visible = True
.Shapes("PIC5").Visible = False
If .Range("D3").Value = "Wednesday" Then
.Shapes("PIC1").Visible = False
.Shapes("PIC2").Visible = False
.Shapes("PIC3").Visible = False
.Shapes("PIC4").Visible = False
.Shapes("PIC5").Visible = False
If .Range("D3").Value = "Thursday" Then
.Shapes("PIC1").Visible = True
.Shapes("PIC2").Visible = False
.Shapes("PIC3").Visible = False
.Shapes("PIC4").Visible = False
.Shapes("PIC5").Visible = True
If .Range("D3").Value = "Friday" Then
.Shapes("PIC1").Visible = True
.Shapes("PIC2").Visible = True
.Shapes("PIC3").Visible = False
.Shapes("PIC4").Visible = False
.Shapes("PIC5").Visible = False
If .Range("D3").Value = "Saturday" Then
.Shapes("PIC1").Visible = True
.Shapes("PIC2").Visible = True
.Shapes("PIC3").Visible = False
.Shapes("PIC4").Visible = False
.Shapes("PIC5").Visible = False
Probably this
Please Login or Register to view this content.
Thank you.
I can stop banging my head against the wall now.
Thank you so much for this.
I have been trying to work with this to work with the date input in D3 rather than having to run a separate macro.
Is that possible?
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks