I'm a bit new to VBA and don't understand how do I assign specific values into array, not the range. I'm trying to do something like this:
Dim toDel(8) As Integer
Set toDel() = Array(1, 3, 5, 6, 7, 8, 10, 12)
But it returns me error. So can I somehow insert a hole array into array without looping through each element? Like we do it in python just array = array
Dim toDel As varianttoDel = Array(1, 3, 5, 6, 7, 8, 10, 12)Array()is a function that returns a Variant array, so you can only assign its result to a Variant. If you had a function that returns a strongly typed integer array, you could assign that to an integer array variable, provided it was declared as a dynamic array. You should not useSet.