Hi Guys,
I would like to change excel function to VBA Code.
Here is the excel function,
1) Basically, if Len(product_name) is less than 3, it should be turned into ~? OR ~??.
5) Finally, all of these keywords should be merged in one cell, and connected with " OR "
And the result is here.
But the problem is that the size of this excel file is too big so it's not easy to deal with.
So I am gonna try VBA so I can easily handle this file.
I can search and learn the basic VBA code.
I just need the SUBSTITUTE(cell," ","") function and FIND(" ", cell) function, cause I have some problem in searching these two function in VBA code.
I know there is REPLACE code in VBA, but still it's so difficult for me T^T.
If you have the solution or if you know the website I can get the solution on, Please let me know.
Thanks a lot.
I would like to change excel function to VBA Code.
Here is the excel function,
=IF(AND(ISERROR(FIND(" ",E3))),IF(LEN(E3)<3,E3&"?"&$F$1&E3&"??",E3&"*"),IF(LEN(E3)>3,SUBSTITUTE(E3," ","")&"*"&$F$1&$E$1&E3&$E$1,SUBSTITUTE(E3," ","")&"?"&$F$1&SUBSTITUTE(E3," ","")&"??"&$F$1&$E$1&E3&$E$1))
1) Basically, if Len(product_name) is less than 3, it should be turned into ~? OR ~??.
UK -> UK? OR UK??
2) And, If there is space in product_name, the space should be deleted.
U K -> UK
United Kingdom -> UnitedKingdom
3) And, If there is space in product_product, it should start with ", and end with ".United Kingdom -> UnitedKingdom
U K -> "U K"
United Kingdom -> "United Kingdom"
4) And, if lend(product_name) is more than 2 or same with 3, it should end with *.United Kingdom -> "United Kingdom"
UntiedKingdom -> UnitedKingdom*
5) Finally, all of these keywords should be merged in one cell, and connected with " OR "
United Kingdom -> UnitedKingdom* OR "United Kingdom"
U K -> UK? OR UK?? OR "U K"
UK -> UK? OR UK??
UnitedKingdom -> UnitedKingdom*
U K -> UK? OR UK?? OR "U K"
UK -> UK? OR UK??
UnitedKingdom -> UnitedKingdom*
And the result is here.
But the problem is that the size of this excel file is too big so it's not easy to deal with.
So I am gonna try VBA so I can easily handle this file.
I can search and learn the basic VBA code.
I just need the SUBSTITUTE(cell," ","") function and FIND(" ", cell) function, cause I have some problem in searching these two function in VBA code.
I know there is REPLACE code in VBA, but still it's so difficult for me T^T.
If you have the solution or if you know the website I can get the solution on, Please let me know.
Thanks a lot.