Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have played with it for an hour, but can't figure out how to make a case
statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Look in the vba help index for
INSTR -- Don Guillett Microsoft MVP Excel SalesAid Software "salgud" wrote in message ... I have played with it for an hour, but can't figure out how to make a case statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
simplistic, but may give you an idea, since you didn't provide much.
Sub test() Select Case True Case InStr(1, "this is a test", "tst") Debug.Print "True" Case Else Debug.Print "False" End Select End Sub -- Gary Keramidas Excel 2003 "salgud" wrote in message ... I have played with it for an hour, but can't figure out how to make a case statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try
Select Case True Case string1 Like "*string2*" etc. End Select -- HTH Bob "salgud" wrote in message ... I have played with it for an hour, but can't figure out how to make a case statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 22 Mar 2010 16:29:40 -0600, salgud wrote:
I have played with it for an hour, but can't figure out how to make a case statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! Thanks to all! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 23 Mar 2010 07:38:15 -0600, salgud wrote:
On Mon, 22 Mar 2010 16:29:40 -0600, salgud wrote: I have played with it for an hour, but can't figure out how to make a case statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! Thanks to all! Gave both methods a try, but neither works! I'm setting a case for worksheets that have "Monthly" in their sheetname (sWsName) I put in: Case sWsName like "Monthly" and Case "Monthly" Like sWsName and Case instr(1,lcase(sWsName),"monthly") and Case InStr(1, sWsName, "Monthly") Am I missing something? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not much point us answering if you don't read it
Case sWsName like "*Monthly*" -- HTH Bob "salgud" wrote in message ... On Tue, 23 Mar 2010 07:38:15 -0600, salgud wrote: On Mon, 22 Mar 2010 16:29:40 -0600, salgud wrote: I have played with it for an hour, but can't figure out how to make a case statement that would be something like: Case is = (string1 contains string2) Is there a way to do this? Thanks! Thanks to all! Gave both methods a try, but neither works! I'm setting a case for worksheets that have "Monthly" in their sheetname (sWsName) I put in: Case sWsName like "Monthly" and Case "Monthly" Like sWsName and Case instr(1,lcase(sWsName),"monthly") and Case InStr(1, sWsName, "Monthly") Am I missing something? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 23 Mar 2010 19:19:10 -0000, Bob Phillips wrote:
Not much point us answering if you don't read it Case sWsName like "*Monthly*" Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check for case of string | Excel Worksheet Functions | |||
Checking if a cell contains a string that is not case sensitive | Excel Programming | |||
Select Case Not Returning Correct String | Excel Programming | |||
Passing a string to Case statement | Excel Programming | |||
Question about comparing mixed case string values | Excel Programming |