Cancelled

Make Excel Function (VBA)

Hi Guys,

I need a function, see below.

'The function should take the colour from the product name

' - First replace special characters with spaces

' - Put every word from string in array (Array1)

' - The colour arrays are filled

' - Check if the Array1 contains any of the values of the colorarryas

' - Modify result to contain the color

' - Make an array of the result

' - remove duplicates from the array

' - Join the array with "|"

Function COLORFROMNAME(cVal As String) As String

' Remove character part

Dim sSpecialChars As String

Dim i As Long

sSpecialChars = "\/:*?™""®<>|.&@#(_+`©~);-+=^$!,'" 'This is your list of characters to be removed

For i = 1 To Len(sSpecialChars)

cVal = Replace$(cVal, Mid$(sSpecialChars, i, 1), " ")

Next

' Fill Arrays

Dim GreyArray() As Variant

GreyArray = Array("grijs", "gri")

Dim BlackArray() As Variant

BlackArray = Array("zwa", "galvano", "zwart", "black")

Dim WhiteArray() As Variant

BlackArray = Array("wit", "white", "weiss", wit)

'Check arryas

Dim result As String

Dim element As Variant

cValArray = Split(LCase(cVal), " ")

For Each element In cValArray

If IsNumeric([url removed, login to view](element, GreyArray, False)) = True Then

result = result & "Grijs" & " "

End If

If IsNumeric([url removed, login to view](element, BlackArray, False)) = True Then

result = result & "Zwart" & " "

End If

If IsNumeric([url removed, login to view](element, WhiteArray, False)) = True Then

result = result & "Wit" & " "

End If

Next

COLORFROMNAME = result

End Function

Skills: PHP, Software Architecture, Visual Basic, Visual Basic for Apps

See more: excel special, vba for word, len in excel, excel vba long, end vba, vba word, len, excel to vba, excel function, excel colour, php string contain, excel vba word, remove characters excel, duplicates excel, vba function, vba character word, excel array, vba architecture, remove vba excel, excel split

About the Employer:
( 43 reviews ) Monnickendam, Netherlands

Project ID: #6715640

3 freelancers are bidding on average €395 for this job

Infowaze21

Hello Employer, I am a developer having 4.5 years experience of- PHP,Software Architect, Asp.Net, .Net, Code-ignitor, MVC, Mysql, Sql server and website management. I have gone through the brief and glad to pro More

€421 EUR in 15 days
(29 Reviews)
5.5
KeertiFiducia

Greetings from Fiducia Infotech India. We are one of the fastest growing companies in [login to view URL] guarantee results,else all your money will be refunded with no question [login to view URL] look forward to work with [login to view URL] :)

€250 EUR in 10 days
(0 Reviews)
0.0
INCtechnology

Hi, We have understand your requirement , we have done a lot of Work with these kind requirement .. Here are some of our work . [login to view URL] [login to view URL] [login to view URL] http More

€515 EUR in 10 days
(0 Reviews)
0.0