I find myself writing some of the same text manipulation formulas all the time, so it seems like a good thing to turn into a function. My first example is taking this formula and "functionizing" it:
This would take everything up to the first space and place it in the cell. My VBA function looks like this:
Function GetFirstWord(Source, WordBreak)
GetFirstWord = Left(Source, InStr(WordBreak, Source) - 1)
If I type the function into a cell on my worksheet as
, how do I get the argument WordBreak value " " to be interpreted correctly in the InStr function. I just don't know enough about delimiters, punctuation, string formatting, etc. in VBA yet. Should be an easy one for you Experts.