View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Defining the length of an array variably

franzklammer wrote:
Is it possible to define the length of an array using a varaible. I have
tried:

Public blnCheckBoxArray(intNumberCheckboxes) As Boolean

but I get error message saying that a fixed value is expected. I ought to be
possible. The integer intNumberCheckboxes is set in the beginning of the
program so it does not change when running. Should I write something like
ByVal? I do not know...Please help me on this one if you can!


Hi franzklammer,

I think you have to leave the brackets empty...

Public blnCheckBoxArray() As Boolean

then after the value of intNumberCheckboxes has been determined you use
the ReDim statement to get the array inplace...

ReDim blnCheckBoxArray(intNumberCheckboxes)

Ken Johnson