ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   searching for the first few characters in an active cell (https://www.excelbanter.com/excel-programming/301777-searching-first-few-characters-active-cell.html)

Chris

searching for the first few characters in an active cell
 
If the active cell has the first 7 characters = "example", I want it to return a value in another cell. ie,

"example 7", "example fourty nine" and "example spiderman"

would all return a value, where as...

"7", "fourty nine" and "spiderman"

would not.

TIA
Chris

ijb[_2_]

searching for the first few characters in an active cell
 
A function in one cell cannot change the value in another cell.
If, on the other hand, you want a function to return a value if another cell
has values as you say, you do not need a vb function.
The following formula will work
=IF(left(sourcecell,7)="example",valueyouwanttoret urn,"")

--
If I've mis-understood the question please tell me.

HTH

ijb

Remove nospam from my e-mail address to talk direct

Not MCSD, MVP, TLA, P&P, PCMCIA, etc just trying to help


"Chris" wrote in message
...
If the active cell has the first 7 characters = "example", I want it to

return a value in another cell. ie,

"example 7", "example fourty nine" and "example spiderman"

would all return a value, where as...

"7", "fourty nine" and "spiderman"

would not.

TIA
Chris





All times are GMT +1. The time now is 06:05 PM.

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