ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to replace defined portion of string (https://www.excelbanter.com/excel-programming/334907-how-replace-defined-portion-string.html)

ExcelMonkey

How to replace defined portion of string
 
Lets say I have a string: Sum(A1:A5).

This string will always be a formula. I want to redefine it without the the
brackets. That I only want to see: Sum

How do I do this. Can I use the replace function? I will always want to
replace everything within the brackets and including the brackets with "".

Thanks

BrianB

How to replace defined portion of string
 

This formula finds the left bracket and takes characters to there.
=LEFT(A1,FIND("(",A1)-1

--
Brian

-----------------------------------------------------------------------
BrianB's Profile: http://www.excelforum.com/member.php...tinfo&userid=5
View this thread: http://www.excelforum.com/showthread.php?threadid=38828


Bob Phillips[_7_]

How to replace defined portion of string
 
I assume you mean in VBA

Debug.Print Left(sFormula, InStr(1, sFormula, "(") - 1)


--
HTH

Bob Phillips

"ExcelMonkey" wrote in message
...
Lets say I have a string: Sum(A1:A5).

This string will always be a formula. I want to redefine it without the

the
brackets. That I only want to see: Sum

How do I do this. Can I use the replace function? I will always want to
replace everything within the brackets and including the brackets with "".

Thanks





All times are GMT +1. The time now is 07:47 AM.

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