ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array questions (https://www.excelbanter.com/excel-programming/333437-array-questions.html)

Perico[_2_]

Array questions
 
When you assign values in a range to a variant, I read that the indexes are
always one-based, even if Option Base 0 is explicitly declared.

Example:
Option Base 0
Dim SalesData
SalesData=Range("A1:F10000")
Customer = SalesData


Would that apply if the coder did this, using the "()", a dynamic array of
variants?:
Option Base 0
Dim SalesData()
SalesData()=Range("A1:F10000")
Customer = SalesData()

I'm also curious, does the code, "Customer = SalesData", assign the same
value as would "Customer = SalesData()"?


I ask because I'm working on some code where the Devleoper wrote code and
I'm trying to figure out whether declaring Option Base would have any impact:

Dim varAddr()
varAddr() = Range("h2:h65536")


Alan Beban[_2_]

Array questions
 
Perico wrote:
When you assign values in a range to a variant, I read that the indexes are
always one-based, even if Option Base 0 is explicitly declared.

Example:
Option Base 0
Dim SalesData
SalesData=Range("A1:F10000")
Customer = SalesData


Would that apply if the coder did this, using the "()", a dynamic array of
variants?:
Option Base 0
Dim SalesData()
SalesData()=Range("A1:F10000")
Customer = SalesData()


What happened when you tried it?

I'm also curious, does the code, "Customer = SalesData", assign the same
value as would "Customer = SalesData()"?


What happened when you tried it?

Alan Beban


All times are GMT +1. The time now is 01:42 PM.

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