How do I declare an array variable in VBA?

后端 未结 7 705
灰色年华
灰色年华 2020-12-08 20:02

I need to add the var in array

Public Sub Testprog()

Dim test As Variant
Dim iCounter As Integer

If test = Empty Then
    iCounter = 0
    test(iCounter) =         


        
7条回答
  •  悲哀的现实
    2020-12-08 20:47

    The Array index only accepts a long value.

    You declared iCounter as an integer. You should declare it as a long.

提交回复
热议问题