ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Macro (https://www.excelbanter.com/excel-programming/376395-simple-macro.html)

OCONUS

Simple Macro
 
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.

bobbo

Simple Macro
 
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


OCONUS wrote:
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.




All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com