Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-18-2017, 03:10 PM
Logit Logit is offline I have a question that I have not seen answered. Windows 10 I have a question that I have not seen answered. Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

.
.
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.
Attached Files
File Type: xlsm Clean String.xlsm (17.4 KB, 9 views)
Reply With Quote
 

Tags
formatting issue, phone number



Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a question that I have not seen answered. 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
I have a question that I have not seen answered. Outlook 2002 deletes or moves answered messages Ken Winter Outlook 3 11-11-2005 10:53 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft