Hi
(sorry for my english) I got a macro, but not run when i put some code in there...
this is my code
*****************
Function Wlookup(wLookup_array As Variant, wTable_array As Range, wCol As Integer, wType As Boolean) Dim i As Range For Each i In wLookup_array Dim Val As String Val = WorksheetFunction.VLookup(("*" & i.Value & "*"), wTable_array, wCol, wType) If Not Val Is Nothing Then Wlookup = Val Exit For End If Next i Wlookup = Val End Function
i dont know why not loop with
Here is the file...Dim Val As String Val = WorksheetFunction.VLookup(("*" & i.Value & "*"), wTable_array, wCol, wType)"
http://www.excelforum.com/attachment...1&d=1278012135
I really appreciate any help...
Last edited by Leith Ross; 07-01-2010 at 03:49 PM. Reason: Added Code Tags
Try this variation
Function Wlookup(wLookup_array As Variant, wTable_array As Range, wCol As Integer, wType As Boolean) Dim Val As Variant Dim i As Range For Each i In wLookup_array Val = InStr(wTable_array.Value, i.Value) If Val > 0 Then Wlookup = i.Offset(0, wCol) Exit Function End If Next i Wlookup = "err" End Function
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
Thanks so much mrice!!! It works... I'll part of that code.... Thanks again!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks