Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 20/01/2010 03:45, Joe User wrote:
"JLGWhiz" wrote: Well, the options appear to be using If...ElseIf...Else...End If The "problem" is: it would have to be of the form: If condition1 Then Goto doit Else If condition 2 Then Goto doit Else If condition3 Then doit: ...statements... End If Not really a problem. Just undesirable. Also, "...statements..." cannot be procedurized easily. How about ... Function test() Dim strName As String strName = "Mr Tibbs" If CheckGreeting(strName) Then MsgBox "Hello " & strName End If End Function Function CheckGreeting(strName As String) As Boolean If Left(strName, 2) = "Mr" Then CheckGreeting = True Else If Left(strName, 2) = "Sr" Then CheckGreeting = True Else CheckGreeting = (Left(strName, 2) = "Ms") End If End Function -- Adrian C |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I optimize this code? | Excel Programming | |||
Conditional Expression in cell | Excel Worksheet Functions | |||
Conditional Expression Question | Excel Worksheet Functions | |||
Conditional Formatting OR Expression?? | Excel Discussion (Misc queries) | |||
Optimize SumProduct | Excel Discussion (Misc queries) |