ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extracting text before a known character (https://www.excelbanter.com/excel-programming/381019-re-extracting-text-before-known-character.html)

Gary Keramidas

Extracting text before a known character
 
just adding to charle's code, if you don't want the underscore

var1 = Left(str1, InStr(1, str1, "_") - 1)


--


Gary


"Charles Chickering" wrote in
message ...
Var1 = Left(str1, InStr(1,str1,"_"))
--
Charles Chickering

"A good example is twice the value of good advice."


"Barb Reinhardt" wrote:

I'd like to extract all text in a string that appears before an underbar.
How would I do this programmatically?

Thanks





All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com