View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Deleting numerical values within a cell

Something different. Works on column A; change to suit and extract text to
column B.

Option Explicit
Sub sistence()
Dim RegExp As Object, Collection As Object, RegMatch As Object
Dim Myrange As Range, C As Range, Outstring As String
Set RegExp = CreateObject("vbscript.RegExp")
With RegExp
.Global = True
.Pattern = "(\D)"
End With
Set Myrange = Range("A1:A100")' Alter to suit
For Each C In Myrange
C.Select
Outstring = ""
Set Collection = RegExp.Execute(ActiveCell.Value)
For Each RegMatch In Collection
Outstring = Outstring & RegMatch
Next
ActiveCell.Offset(0, 1).Value = Outstring
Next
Set Collection = Nothing
Set RegExp = Nothing
Set Myrange = Nothing
End Sub

Mike

"thd3" wrote:

I have a column with numbers and text - I want to delete all numerical values
and leave the text intact. Any help would be greatly appreciated.