View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Remove any letter from a referenced cell

apologies, it's insert MODULE and paste it in there

Mike

"FiluDlidu" wrote:

Hi Mike,

This sounds very promising, but I only have "user form", "module" and "class
module" in the "insert" sub-menu available when I right-click on 'this
workbook'...

Which one should I choose or what should I do to get to where you think I
should be???

Thanks.

"Mike H" wrote:

Hi,

Alt + f11 to open VB editor. Right click 'this workbook' insert function and
paste this in

Function extractthings(rng As range)
Set RegExp = CreateObject("vbscript.RegExp")
With RegExp
.Global = True
.Pattern = "[\d\-\&]"
End With
Outstring = ""
Set Collection = RegExp.Execute(rng)
For Each RegMatch In Collection
Outstring = Outstring & RegMatch
extractthings = Outstring
Next
End Function

then in b1 insert the formula

=extractthings(a1)

Mike