excel / vba - I want text from string until number

  Heefie 11:05 31 Dec 2004
Locked

I know I can do this in a long-winded way, with a few lefts and rights and len statements, I'm just wondering if there's a shorter way ...

I have a number of records that begin with a character string & end with a number, as in :

ABC6


ABCDEFG9


ABCD23


ABCDEFGHI6


... is there a simple expression / formula that I can use to extract JUST the Alpha string from the start ?!?!

Cheers in advance for any help ...

  pc moron 16:38 31 Dec 2004

This does the job:

=LEFT(A1,MIN(IF(ISNUMBER(FIND({1,2,3,4,5,6,7,8,9,0},A1)),FIND({1,2,3,4,5,6,7,8,9,0},A1)))-1)

For ref 6th post here click here

  Heefie 01:32 01 Jan 2005

That works fine, but I needed it to work in VBA, so I've sorted it now ...

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

What went wrong at the Designs of the Year 2017

iPhone X news: Release date, price, new features & specs

Comment utiliser Live Photos ?