$$Excel-Macros$$ type mismatch at "End Function"

2010-03-24 Thread scubagirl
I have a function that does some Dictionary operations, and it compiles and runs perfectly. However, at the "End Function" line, I get a runtime error 13 - type mismatch error. Public Function CalcResourceUtilization() Dim t As Task Dim r As Resource Dim it As Integer Dim day As D

Re: $$Excel-Macros$$ macro efficiency

2010-03-22 Thread scubagirl
Thanks for your suggestions/help. I checked to make sure that all of the loops use "Exit For" when appropriate. I am using Excel 2007 which *could* be causing some of the slowdown, but Excel only really comes in at the end for result output, it could explain why my speed tests are so slow (I've bee

$$Excel-Macros$$ macro efficiency

2010-03-18 Thread scubagirl
I have a fairly large VBA project for work - it runs a Monte Carlo simulation on some data that is grabbed from MS Project. It takes longer than I'd like to run - about 4 minutes for 1000 iterations, not including writing out to Excel. I have done everything I can think of to make it efficient: usi

$$Excel-Macros$$ Excel - sort with VBA problems

2010-03-18 Thread scubagirl
Hi everyone, I have a program that generates Excel workbooks with multiple sheets of data , and a function that create a chart each time it's called, which happens 2 times per workbook. In order to make the chart, I have to sort the data first, which I've tried a few different ways. No matter which

Re: $$Excel-Macros$$ multidimensional array - type mismatch

2010-03-16 Thread scubagirl
Oh, of course, changing it to m_task_cost(i, IterationCount) solved the problem. I thought I was probably missing something that should have been obvious... thanks for your help. On Mar 16, 5:54 am, Paul Schreiner wrote: > Oooh... that's very "old school" array callouts!!! > > If I REMEMBER corr

$$Excel-Macros$$ multidimensional array - type mismatch

2010-03-15 Thread scubagirl
Hello, I am trying to assign values to an array of doubles, as follows: Public Function BillTime(cost As Double, i As Integer) m_task_cost(i)(IterationCount) = cost End Function the array is declared and later dimensioned using Dim m_task_cost() as Double ReDim m_task_cost(1 To tsize, 0 To