Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add more symbols in a function/module 1

Status
Not open for further replies.

greekpatriott

Technical User
Dec 15, 2004
65
CY
Want to change this function
Public Function WBSTopLevel(Val1 As String) As String

If InStr(Val1, ".") > 0 Then
WBSTopLevel = Left(Val1, InStrRev(Val1, ".") - 1)
Else
WBSTopLevel = Val1
End If
End Function

to this
Public Function WBSTopLevel(Val1 As String) As String

If InStr(Val1, "." Or "-") > 0 Then
WBSTopLevel = Left(Val1, InStrRev(Val1, "." Or "-") - 1)
Else
WBSTopLevel = Val1
End If
End Function

But it does not work. Does anyone have a clue how to add more simples in this module?? Cheers
 
If InStr(Val1, ".") > 0 Then
WBSTopLevel = Left(Val1, InStrRev(Val1, ".") - 1)
ElseIf InStr(Val1, "-") > 0 Then
WBSTopLevel = Left(Val1, InStrRev(Val1, "-") - 1)
Else
WBSTopLevel = Val1
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top