![]() |
|
#3
|
|||
|
|||
|
.
. Code:
Option Explicit
Sub CleanAll()
Dim rng As Range
For Each rng In Sheets("Sheet1").Range("A1:A15").Cells 'adjust sheetname and range accordingly
rng.Value = AlphaNumericOnly(rng.Value)
Next
End Sub
Function AlphaNumericOnly(strSource As String) As String
Dim i As Integer
Dim strResult As String
For i = 1 To Len(strSource)
Select Case Asc(Mid(strSource, i, 1))
Case 48 To 57, 65 To 90, 97 To 122: 'include 32 if you want to include space
strResult = strResult & Mid(strSource, i, 1)
End Select
Next
AlphaNumericOnly = strResult
End Function
Paste the above into a Routine Module. Activate with a CommandButton on the sheet in question. |
| Tags |
| formatting issue, phone number |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro Needed to Insert Asnwer to A Question in Multiple Choice Format Question
|
rsrasc | Word VBA | 7 | 03-28-2014 12:28 PM |
| Track un-answered emails ? | antoinel | Outlook | 0 | 02-23-2011 05:36 AM |
| Need help with this question... | lllDNYlll | Outlook | 0 | 05-04-2006 07:17 AM |
| Categories question & replying with attachment question | glitzymama | Outlook | 0 | 03-15-2006 09:32 AM |
Outlook 2002 deletes or moves answered messages
|
Ken Winter | Outlook | 3 | 11-11-2005 10:53 AM |