I am struggling with a conversion to array in VBA :
Dim list As Range
Set list = Range(series, series.End(xlDown))
list.Select
Dim table() As Variant
Set table = list.value
My understanding is that value returns an array right ? I don’t get why VBA tells me that I "can't assign to array".
My list range looks like that in Excel at the Select, and i aim at having that as an array so that I can format my dates using something like Format(table.Rows(i).Columns(1).value, "yyyy-mm-dd"), looping on my table.
02-Sep-09 1.00
18-Sep-09 1.00
16-Oct-09 1.00
20-Nov-09 1.00
18-Dec-09 1.00
19-Mar-10 1.00
18-Jun-10 1.00
By the way, is it possible to modify the table in place ?
Thanks !
There are a number of problem here.
Problem 1
table is not an object so you cannot set it. Try:
Problem 2
series is a VBA keyword associated with charts. Please pick a name, such as MyWSTable, which means nothing to VBA.
Problem 3
A worksheet name is not itself a range. Try:
Note: you do not need variable list nor do you need to select the range.
Answer to formatting question
The following code will reformat your dates: