Routine #12 from our series of text subroutines to use in EXCEL to extract all the alphanumeric characters. Everything that does not fall under alphanumeric character will be automatically removed from the selected cells content.
Code snippet below:
Sub AlphaNumericOnly() 'Keep only alphanumeric characters Dim selected_range As Range Set selected_range = Range(Selection.Address) Dim i As Integer Dim strResult As String Dim old_value As String For Each cell In selected_range old_value = vbNullString: old_value = cell.Value For i = 1 To Len(old_value) 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 cell.Value = strResult Next
You can see how to add this to Excel in order to use the code in this thread UPPER CASE
Aw, this was an exceptionally good post. Taking the time and actual effort
to make a superb article… but what can I say… I put things off
a whole lot and never manage to get anything done.
Sƿot on with thіs write-up, I ѕeriously believ this website neeɗs much more attention. I’ll prpbably be back again to see more, tҺanks for the advice!
Look at my website: gallery.wazzat.co.za