Solved

Select Case Help

Posted on 2014-01-21
3
235 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Computers reporting Windows patches applied 14 78
Find word and 6 digit number 22 97
Control calculations in Excel using VBA 4 18
excel pivot question 4 40
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now