Simple Macro

G

Guest

I'm new at this, but I'm trying to create a macro with visual basic that
references an array. Can someone give me an example of this. The array is a
78 row, two column seperate s/s.
 
B

bobbo

Are you manipulating an array on the worksheet or are your creating an
array in VBA?

To create an array in VBA this is the dim statement

Dim MyArray( 1 to 78, 1 to 2) as Variant

to assign values

MyArray( 1, 1) = 45
' First row first column value is 45
MyArray( 1, 2) = Activesheet.Range("C2").value
' First row second column value is the value of cell C2

I do not know about manipulating worksheet arrays with code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top