Skip to main content

Creating a number of variables

Is there a way to let the user define a number and than the script creates that number of variables (dim as string)? I thought i would be something likes this:
 
Option Explicit
Dim LimitQ As String
Dim i As Integer
LimitQ = 5
For i =0 To LimitQ
Dim Limit(i) As String
Next i
Sub main
End Sub
 
 
 

Robert van den… Thu, 09/06/2018 - 10:03

In reply to by Brian Element

That does the trick. The last problem i have with this script is the group by option in the stratification function. When IDEA runs the script and sees it goes above 80 groups it produce a warning  (see xlsx file) and the script stops. I tried this: IgnoreWarning(True). But it won't help. Is there a way to skip and hide this warning? Other wise i need to build some code that before the stratification the selected field is summarized and checked that the totale records doesn't exceed 80.

Brian Element Thu, 09/06/2018 - 12:20

In reply to by Robert van den…

Hi Robert,

I think the problem is you are using the group by instead of the FiedlToStratify.  What you are doing is adding a large number of groupings and that is what is giving you the error.

The part highlighted in yellow is what you are adding fields to in your sciprt, instead of the field to stratify.  Try making the change and hopefully that will get your script working.

Brian