View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
FiluDlidu FiluDlidu is offline
external usenet poster
 
Posts: 66
Default Remove any letter from a referenced cell

Perhaps a bit off-subject, but it's my thread so I guess I can do what I want
from it (can't I?)...

How would you cut out anything beyond the first set of, say numbers, in say
the following string (?):
aBc123Def45
(from the preceding I would like to get "123" only, and drop "45")

Is it too much asking??

"Mike H" wrote:

Your welcome.

I noticed after you had included the space in your required output. If you
do want spaces output then change the pattern to
.Pattern = "[\d\-\&\?\"" ""]"

Mike




"FiluDlidu" wrote:

Thank you so much Mike!

I've been wondering for a few years now how to create a function in Excel
and cursing at the impossibility to use regular expressions.

You have way more than answered my question: you also showed me
possibilities I was eager to know but didn't know where to look for and how
to get started.