I am trying to define an array in vba that is based on a variable number of elements but I want to try and limit the size of the contents of the array elements to a calculated number of characters is this possible?
for example a normal string declaration of size 5 characters in length can be defined as:
Dim MyString As String * 5
is it possible to do something like the below??
ReDim MyArray (1 to MyLastRow) As String * MyCharCount
Reason I want to be able to do this is to loop through a huge number of rows inside an array but want to keep memory requirements lower to enable running code on larger arrays of data inside memory without having to chunk it up. The data being analysed is of type string.
I get a constant expression required error when I compile it so I am guessing no. If any MSFT expert / developer knows a way around this (or anyone else) I'd love to hear from you please.
thanks