I need to create a function (or macro, which ever is easier) in excel that returns "Text1" if a selection CONTAINS "Specified Text1" or if it contains "Specified Text2" then return "Text2" and if it contains "Specified Text3" then return a value of "Text3".
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
- How to create a hyperlink to a different Excel she
Till further clarification i asume your question to like in my comment asked:
To get this by formula:
For doing it as an UDF try this: (not case sensitive)
And use it like
LOOKUP
I am going to assume that the actual strings are not "Specified Text" and some number. That they are in fact separate unique strings.
You could use nested if statements:
Try,