Arrays in VBA – Part 2: Array Assignment Rules

April 29, 2013 in VBA

Arrays are powerful tools in VBA. However, the many types of arrays and the fact that in VBA arrays are value types means that assigning array variables is tricky business. In this post I’ll explain all the rules involved. In a future post I’ll dive into the implications of value-type semantics for arrays. This post refers to reference and value types a lot. If you need a refresher on what that means, start with Values and References in VBA. Assignment rules You cannot assign TO fixed-length arrays, EVER I’ll start with the simplest rule: The VBA compiler does not allow
…read more