Remember Me?

#1
May 24th 06, 10:56 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: May 2006 Posts: 5
type mismatch error in Benford's law macro

I am trying to run a Benford's law analysis. I get a run time error 13 -
type mismatch at the following point of the macro:
For Colcells = 1 To Row
x = Left(Cells(Colcells,Step), 2)
If x 9 Then
Arraytwotest(x) = Arraytwotest(x) +1
End If

There is a series of arrays for each of the 9 digits of a number. going from
arrayone to arrayzero. Then there is an array named arraytwotest(10 to 99)
as Integer so that a one digit number does not create an error. This is a
fraud application that published in the Journal of Accountancy in August 2003
and did not make any changes other than import my data file. Any suggestions?

#2
May 24th 06, 11:07 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Aug 2004 Posts: 1,163
type mismatch error in Benford's law macro

The Left function returns a string value; you are at least implicitly
converting your number to string. Make it x = Val(Left(Cells(Colcells,Step),
2))
--
- K Dales

"Sody" wrote:

I am trying to run a Benford's law analysis. I get a run time error 13 -
type mismatch at the following point of the macro:
For Colcells = 1 To Row
x = Left(Cells(Colcells,Step), 2)
If x 9 Then
Arraytwotest(x) = Arraytwotest(x) +1
End If

There is a series of arrays for each of the 9 digits of a number. going from
arrayone to arrayzero. Then there is an array named arraytwotest(10 to 99)
as Integer so that a one digit number does not create an error. This is a
fraud application that published in the Journal of Accountancy in August 2003
and did not make any changes other than import my data file. Any suggestions?

 Posting Rules Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On

 Similar Threads Thread Thread Starter Forum Replies Last Post Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM ub Excel Worksheet Functions 2 September 26th 07 12:48 PM Jurassien Excel Discussion (Misc queries) 3 February 23rd 07 08:14 PM lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM Paul Excel Discussion (Misc queries) 0 October 25th 05 07:28 AM

All times are GMT +1. The time now is 11:44 PM.