LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Text wildcards

I wrote the following function to return vendor numbers from the name of the
vendor and the account number. Here is what I have so far.

Option Explicit
Function Vendor(VR As Variant) As String

Application.Volatile True

Dim VenNam As String
Dim Acct As Variant
Dim Crit As Variant

VenNam = RRLookup(VR, 4)

Select Case VenNam
Case Is = "Acme"

Acct = Strings.Left(RRLookup(VR, 11), 12)

Select Case Acct
Case Is = "123456789", "12 3456", "987654", "123 456"
Vendor = "36359"
Case Is = "45678", "987 65"
Vendor = "2810"
Case Is = "246810", "1357", "12345 6", "6789 45","456 879"
Vendor = "2814"
Case Else

Crit = RRLookup(VR, 5)

If Crit = "111-111-2222" Then
Vendor = "39363"
If Crit = "78904561-23" Then
Vendor = "39775"
If Acct = "Semi-Annual " Then
Vendor = "42026"
Else
Vendor = "Not Found"
End If
End If
End If
End Select


End Select
End Function

RRLookup is a custom function that will return a text string. This works but
if the text string returned is only ACME but many times the string returned
"ACME of Southern Michigan" it does not evaluate. I tried changing the first
case under the select case vennam to:

Case Is = "ACME*"
and
Case Is = "ACME" & "*"

but this does not work. I am trying to make this a general function for all
of my vendors, so keying in on just ACME will not help all that much.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If function with text & wildcards Kpercy Excel Worksheet Functions 3 March 9th 09 11:34 PM
using wildcards on text scott Excel Worksheet Functions 1 September 21st 06 05:45 PM
Search text using wildcards? ackurv Excel Programming 2 October 21st 04 02:25 AM
Search text using wildcards? ackurv[_2_] Excel Programming 0 October 20th 04 10:39 PM
Using wildcards within a text box JENNA Excel Programming 1 January 27th 04 05:00 AM


All times are GMT +1. The time now is 09:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"