Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Function to Sub
I have the following function which is used to extract the numeric and alpha
characters from a cell. Can someone help me 'convert' this to a sub, so that, for example, with whatever range the user selects, the code will look at each cell and basically remove everything that is not either alpha or numeric? Example: 45 BJ}!12T would be converted to 45BJ12T Public Function ExtractNT(TextString As String) As String Dim x As Long Dim sChar As String ExtractNT = vbNullString For x = 1 To Len(TextString) sChar = Mid(TextString, x, 1) If sChar = "0" And sChar <= "9" Or sChar Like "[a-zA-Z]" Then ExtractNT = ExtractNT & UCase(sChar) End If Next x End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using the 'Convert' function | Excel Worksheet Functions | |||
can the "convert" function in excel convert to UK gallons? | Excel Discussion (Misc queries) | |||
Convert function to value | Excel Discussion (Misc queries) | |||
Convert function to value | Excel Discussion (Misc queries) | |||
Need a function to convert value in its name | Excel Worksheet Functions |