Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement Question
hello everyone
I have a question about if statments in programming. First is can wildcards be used. I want to check if a column has words that start with FA_Panels_. There are about 6 different names that start with that word, example FA_Panels_NAC, FA_Panels_FACP, FA_Panels_VESDA,ETC.. I don't want to write a IF statment for each one. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement Question
Hi,
Yes you can use the 'Like' operator If Range("A1").Value Like "Fa*" Then End If Mike "Novice Lee" wrote: hello everyone I have a question about if statments in programming. First is can wildcards be used. I want to check if a column has words that start with FA_Panels_. There are about 6 different names that start with that word, example FA_Panels_NAC, FA_Panels_FACP, FA_Panels_VESDA,ETC.. I don't want to write a IF statment for each one. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement Question
the below will work from column 'A2'
=IF(LEFT(A2,10)="FA_Panels_","yes","no") "Novice Lee" wrote: hello everyone I have a question about if statments in programming. First is can wildcards be used. I want to check if a column has words that start with FA_Panels_. There are about 6 different names that start with that word, example FA_Panels_NAC, FA_Panels_FACP, FA_Panels_VESDA,ETC.. I don't want to write a IF statment for each one. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement Question
Novice Lee wrote:
I have a question about if statments in programming. First is can wildcards be used. I want to check if a column has words that start with FA_Panels_. There are about 6 different names that start with that word, example FA_Panels_NAC, FA_Panels_FACP, FA_Panels_VESDA,ETC.. I don't want to write a IF statment for each one. If (Left (columnName, Len ("FA_Panels_")) = "FA_Panels_") Then ' do something End If HTH, Lars |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement Question
Modified from the vba help index for FINDNEXT.
Sub findtext() With Worksheets("sheet3").Range("g1:g50") Set c = .Find("FA_Panels", LookIn:=xlValues, lookat:=xlPart) If Not c Is Nothing Then firstAddress = c.Address Do 'c.Value = 5 MsgBox c.Row Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Novice Lee" wrote in message ... hello everyone I have a question about if statments in programming. First is can wildcards be used. I want to check if a column has words that start with FA_Panels_. There are about 6 different names that start with that word, example FA_Panels_NAC, FA_Panels_FACP, FA_Panels_VESDA,ETC.. I don't want to write a IF statment for each one. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement Question
Don Guillett wrote:
Modified from the vba help index for FINDNEXT. [.. lots of code ..] Motto: Why do it the easy way, when there's a complicated one? *g* S,CNR, Lars |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Another IF statement question | Excel Worksheet Functions | |||
If Statement Question | Excel Worksheet Functions | |||
If then statement question.... | New Users to Excel | |||
If statement question | Excel Programming | |||
If Statement Question | Excel Worksheet Functions |