Found a solution. Sharing in case someone else needs similar function.
Function wordPosition(sentence As String, searchWord As String) As Long
Dim words As Variant
Dim i As Long
words = Split(sentence, ",")
For i = LBound(words, 1) To UBound(words, 1)
If words(i) =...
Hi all,
Thank you in advance for your help.
In cell A2 I have: Field3,Field8,Field9,Field10
In cell B2 I would like to get: 2 (the position of the 2 word Field8 in string)
I tried using InStr in UDF
In cell B2 I am using below function: FindWordPosition(A2,"Field8")
result of function in...
Hi Andy,
Understood, apologies for not following. Yes, ""ID ,Type, ISIN" is a part of your UDF and will ALWAYS be a part of your outcome if in Cell A1 contains one of these items "Field 3, Field 4, Field 8, Field 9, Field 10
Hi Andy,
i am using the following UDF, but it is not replacing all values only one
Function Replace3(expression As String) As String
Dim strWhat As String, strRep As String
Dim arrWhat As Variant, arrRep As Variant
Dim i As Long
On Error GoTo Replace3_Error
strWhat =...
Hi Andy,
Thank you for your response. Apologies for not being clear:
In Cell A1 I Have: Field 3, Field 4, Field 8, Field 9, Field 10
In Cell B1 I would like to get: ID, Type, ISIN, Date, Field 10
I want to only replace a subset of fields in cell not all. Hope that is clearer. Thank you in...
Hi all,
Thank you in advance for your help. I am working on a function in cell B to find and replace text in cell A. I still need cell A is a field I and cell B is a classification of that ID. The UDF I have only replace 1 (the last string in example below Date) of the three strings I want...
Hi all,
Thank you for your feedback. Apologies I was not very specific. I need help with writing the VBA code. Thank you again for your input and feedback.
Hi Skip and Combo,
Thank you both for your replies. Combo you are correct in your logic. I am not that technically savvy yet to use array of words. Would need your help with the VBA code. Any suggestions would be greatly appreciated.
Skip - for example: The value for this field 3, field 8...
Hi all,
Struggling to find solution for this one. I need to loop through rows in column A and populate columns B1:Nth1 with text = field & # from row. Then populate values in column B2:Nth# from values in based on values in sting in column A. See attached example. Items in yellow are derived...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.