Solved

Select Case Help

Posted on 2014-01-21
3
239 Views
Last Modified: 2014-01-21
I have the code below ,but the data has changed so I need to look for "CLEAR" in that cell that will have other data now.  For example  K5 would read "Light Intensity CLEAR"  how do i adjust to look for CLEAR with other data now in the cell. Thanks
Set ws = Sheets("Sheet19")
Set ws_pic = Sheets("Pic")
   
Set cel = ws.Range("k5")
Select Case cel
Case "CLEAR"
    Set Shp = ws_pic.Shapes("Picture 30")
Case "FEW CLOUDS"
    Set Shp = ws_pic.Shapes("Picture 32")
Case "PARTLY CLOUDY"
    Set Shp = ws_pic.Shapes("Picture 28")
0
Comment
Question by:sandramac
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39798860
Set cel = ws.Range("k5")
Select Case True
Case instr(1,cel,"CLEAR") > 0
    Set Shp = ws_pic.Shapes("Picture 30")
Case instr(1,cel,"FEW CLOUDS") > 0
    Set Shp = ws_pic.Shapes("Picture 32")
Case instr(1,cel,"PARTLY CLOUDY") > 0
    Set Shp = ws_pic.Shapes("Picture 28")

Open in new window

0
 

Author Closing Comment

by:sandramac
ID: 39798946
Thank You
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39799064
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question