VBA Problem.... One for someone far smarter than i am.!!!

bundybear

New Member
Joined
Oct 30, 2013
Messages
10
Hi all,

I am trying to use this user
defined function called RANGEMATCH that i had a look at being used elsewhere being the following code

Function RANGEMATCH(SearchIn As Range, SearchFor As Range)
'
'
For Each Cell In SearchFor
If InStr(SearchIn, Cell) Then
RANGEMATCH = Cell.Value
Else
RANGEMATCH = ""
End If
Next Cell

End Function

[FONT=Helvetica Neue, Helvetica, Arial, san-serif]Then I am calling up the function and directing it to search my description cell (SearchIn) and then pointing it to my named data range (SearchFor) but it doesn't quite work. It does work if the last item say the 5th item out of a list of 5 in my search list is found but if it is the 1st, 2nd, 3rd or 4th in the list of 5 then this [/FONT][FONT=Helvetica Neue, Helvetica, Arial, san-serif]doesn't[/FONT][FONT=Helvetica Neue, Helvetica, Arial, san-serif] seem to work at all?????? [/FONT]

[FONT=Helvetica Neue, Helvetica, Arial, san-serif]I know i am probably missing something very simple but this is driving me nuts!!! [/FONT]

[FONT=Helvetica Neue, Helvetica, Arial, san-serif]Any ideas please???[/FONT]
 
Yep, that's doable
I'd suggest recording a macro of 1 of the advanced filters and the copy / paste process....then post it back here with the other criteria, hopefully we can then help you modify it.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,217,388
Messages
6,136,313
Members
450,003
Latest member
AnnetteP

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top