dichiari la matrice
dim Matrice() as tipo_di_dato
e poi la ridimensioni
così

redim Matrice(x[,...]) as tipo_di_dato