You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects Visual Basic for Application (VBA) forum

Creating Arrays in VBA   Solana Foo Oct 19, 2009
Re: Creating Arrays in VBA   Sanjay Rana Oct 20, 2009
Re: Creating Arrays in VBA   Solana Foo Oct 20, 2009
Re: Creating Arrays in VBA   Solana Foo Oct 20, 2009
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Creating Arrays in VBA 
Author Solana Foo 
Date Oct 19, 2009 
Message Hello,

I am trying to build an array of text values, which I will retrieve from user input controls. The array will vary in size, according to whether or not the user enters a value in that control. Is this possible in VBA? Where do I go for basic syntax and coding? I looked up Arrays in the VBA help and could not figure it out.

Thanks so much!! 
  SF 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Creating Arrays in VBA 
Author Sanjay Rana 
Date Oct 20, 2009 
Message See this webpage for information on how to create dynamic arrays

http://www.cpearson.com/Excel/VBAArrays.htm 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Creating Arrays in VBA 
Author Solana Foo 
Date Oct 20, 2009 
Message I continue to be confused. I wonder if what I am calling an array is different than what it is in VBA. I don't want an array with rows and columns, I just want a variable that holds comma delimited values, something like this:

Dim arrayValues as Array

arrayValues.add ("Text Input1")
arrayValues.add("Text Input2")
arrayValues.add ("Text Input3")

resulting in: arrayValues = ["Text Input1", "Text Input2", "Text Input3"]

I this different than what you are talking about? Does the length of the array need to be specified for this? 
  SF 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Creating Arrays in VBA 
Author Solana Foo 
Date Oct 20, 2009 
Message I think I found what I was looking for. I think I just needed to create a collection object! The code works fine that way.

Also see:
http://forums.esri.com/Thread.asp?c=93&f=993&t=151011
 
 
Dim qArray As New Collection   

qArray.Add (expMLS)
qArray.Add (expUseCode)

Debug.Print qArray(1) & ", " & qArray(2)
'returns the values of expMLS and expUseCode
 
  SF