simple function question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



OK, I can't get this function to return anything other than #VALUE! What am
I doing wrong? The function is in a module, and the input parameter is a
reference to a cell containing an integer.

Function my_digit_patt(a) As Integer
Dim ct(9) As Integer
For i = 1 To Len(a)
ct(Val(Mid(a, i, 1))) = ct(Val(Mid(a, i, 1))) + 1
Next
b = 0
For i = 0 To 10
b = b + ct(i) * 10 ^ (10 - i)
Next
my_digit_patt = b
End Function


.



Relevant Pages

  • RE: Data Move
    ... Parts Prev: 7,669.92 ... 7,669.92 is one cell. ... Dim x As Variant ...
    (microsoft.public.excel.programming)
  • Find do not work with decimal point
    ... then find miss the cell even though it really exist. ... Dim y As Integer, x As Integer ... Dim B As String, A As String, A1 As Long, B1 As Long ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: Alignment
    ... Dim c As Long ... > If cell Ec is greater than 0 the wording in cell Cc is aligned right, ... > other wise wording in cell Cc is aligned left. ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: passing parameters to a procedure
    ... Dim exchangeRate As Double ... Here's how i passed an input parameter in a button's click procedure (and it ... Dim myEuro As Double ...
    (microsoft.public.vb.general.discussion)
  • Re: simple function question
    ... The function is in a module, and the input parameter is a ... Depending on the ... your data type. ... Prev by Date: ...
    (microsoft.public.excel.programming)