Blobajob88
Board Regular
- Joined
- Mar 27, 2020
- Messages
- 55
- Office Version
- 365
- 2019
- Platform
- Windows
Hi, can someone please explain to me in simple terms why you have to ReDim an array. For example
Here, I need to first declare:
Dim TopClients () As Variant
Dim Dimension1 As Long, Dimension2 As Long
Dimension1 = Range("A3", Range("A2").end(xldown)).cells.count -1
Dimension2 = Range("A2",Range("A2").End(xltoright)).cells.count -1
ReDim TopClients(0 to Dimension1, 0 to Dimension2)
Why couldn't I just go:
Dimension1 = Range("A3", Range("A2").end(xldown)).cells.count -1
Dimension2 = Range("A2",Range("A2").End(xltoright)).cells.count -1
Dim TopClients (0 to Dimension1, 0 to Dimension2) As Variant
Here, I need to first declare:
Dim TopClients () As Variant
Dim Dimension1 As Long, Dimension2 As Long
Dimension1 = Range("A3", Range("A2").end(xldown)).cells.count -1
Dimension2 = Range("A2",Range("A2").End(xltoright)).cells.count -1
ReDim TopClients(0 to Dimension1, 0 to Dimension2)
Why couldn't I just go:
Dimension1 = Range("A3", Range("A2").end(xldown)).cells.count -1
Dimension2 = Range("A2",Range("A2").End(xltoright)).cells.count -1
Dim TopClients (0 to Dimension1, 0 to Dimension2) As Variant