Avatar of AFGPHXExcel
AFGPHXExcel

asked on 

How do I identify different strings in a Range with a Case?

I have a range of 4 cells. Each cells can contain a particular phrase. I would like to use a case to identify if there is a string in any of the cells in the Range. Current the code can only look at one of the cells at a time. The code:

    Select Case Range("Rd_Reviewer1ReqBy_Attachment1").Value
   
    Case "LOJ"
    v_WksNames = Array("RequirementSummary", "Reviewer1", "LOJ")
    Call M_CreateMultiWksFile(v_WksNames)
   
    Case "Review File - ACO"
     v_WksNames = Array("Reviewer2")
    Call M_CreateMultiWksFile(v_WksNames)
   
    Case "Review File - Camp Mayor"
     v_WksNames = Array("Reviewer3")
    Call M_CreateMultiWksFile(v_WksNames)
   
    Case "Review File - Chief of Staff Approving O6"
     v_WksNames = Array("Reviewer8")
    Call M_CreateMultiWksFile(v_WksNames)
   
    End Select

Any help would be much appreciated.
Microsoft Excel

Avatar of undefined
Last Comment
Saqib Husain
ASKER CERTIFIED SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Maybe you can use

if cell1="..." then
    .....
elseif cell2="..." then
    .....
elseif cell3="..." then
    .....
elseif cell4="..." then
    .....
endif
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo