Hi
I am having a basic problem. I am trying to create a udf. Its very basic I just want a udf for converting a cell range well not converting removing non numeric characters and leaving only numbers.
I can't figure how to put a placeholder in the udf to stand for whatever cell range selected by user.
This is where I am at.
this is the resources am I using
http://www.tmehta.com/regexp/examples.htm
http://www.mvps.org/dmcritchie/excel/install.htm#install
Edit: This is what some of the example data looks like, I just want the numbers.
<table width="64" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64"> <tbody><tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; width: 48pt;" width="64" height="35">[ 4]</td> </tr> <tr style="height: 39pt;" height="52"> <td class="xl65" style="height: 39pt; border-top: medium none; width: 48pt;" width="64" height="52">[ 1]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 9]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 7]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 6]</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none; width: 48pt;" width="64" height="20">[10]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[11]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 8]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 5]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 2]</td> </tr> </tbody></table>
I am having a basic problem. I am trying to create a udf. Its very basic I just want a udf for converting a cell range well not converting removing non numeric characters and leaving only numbers.
I can't figure how to put a placeholder in the udf to stand for whatever cell range selected by user.
This is where I am at.
Code:
Public Function RegExNumbers() As Integer
i = Selected cell range
RegExpSubstitute(i,"[^a-zA-Z0-9]+","")
End Function
http://www.tmehta.com/regexp/examples.htm
http://www.mvps.org/dmcritchie/excel/install.htm#install
Edit: This is what some of the example data looks like, I just want the numbers.
<table width="64" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64"> <tbody><tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; width: 48pt;" width="64" height="35">[ 4]</td> </tr> <tr style="height: 39pt;" height="52"> <td class="xl65" style="height: 39pt; border-top: medium none; width: 48pt;" width="64" height="52">[ 1]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 9]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 7]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 6]</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt; border-top: medium none; width: 48pt;" width="64" height="20">[10]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[11]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 8]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 5]</td> </tr> <tr style="height: 26.25pt;" height="35"> <td class="xl65" style="height: 26.25pt; border-top: medium none; width: 48pt;" width="64" height="35">[ 2]</td> </tr> </tbody></table>
Last edited: