Excel VBA - avoid Error 1004 writing UF ListBox Array to Sheet

后端 未结 1 1429
梦如初夏
梦如初夏 2021-01-16 05:37

Task

My intention is to write back UserForm Listbox data to a sheet range in the most efficient way using the data field method.

Bas

相关标签:
1条回答
  • 2021-01-16 06:00

    Lbound(v,1) = 0 ubound(v,1) = r-1 so, it needs to modify i and j.

      For i = 0 To R - 1
          For j = 0 To C - 1
             v(i, j) = IIf(Left(Me.ListBox1.List(i, j) & "", 1) = "=", " ", "") & _
                                 Me.ListBox1.List(i, j)
          Next j
      Next i
    
    0 讨论(0)
提交回复
热议问题