textbox1到textbox10,有10个textbox(但是有可能不是一个序列),分别放到a到j列的有数据一行的下一个单元格(只要该行的任意单元格有数据,都将textbox数据放到(从a到j列)的下一个单元格)希望能够解决 比如说,第3行 任何一个单元格不等于空白,则textbox1到textbox10 的数据都能放到第四行的1-10列。Private Sub CommandButton1_Click()
Dim Arr
Dim m, n As Integer
Arr = Split("1,2,4,10,8,33,7,22,44,12")
With ActiveSheet
m = .Cells.SpecialCells(xlCellTypeLastCell).Row + 1
For n = LBound(Arr) To UBound(Arr)
.Cells.Cells(m + 1, Arr(n) + 1) = UserForm1.Controls("TextBox" & Arr(n)).Text
'xlInsideVertical
Next n
End With
End Sub
这段代码不能找到指定对象,谁能帮我改一下这段代码,或者看看哪里出问题了?小弟先谢谢了。
Dim Arr
Dim m, n As Integer
Arr = Split("1,2,4,10,8,33,7,22,44,12")
With ActiveSheet
m = .Cells.SpecialCells(xlCellTypeLastCell).Row + 1
For n = LBound(Arr) To UBound(Arr)
.Cells.Cells(m + 1, Arr(n) + 1) = UserForm1.Controls("TextBox" & Arr(n)).Text
'xlInsideVertical
Next n
End With
End Sub
这段代码不能找到指定对象,谁能帮我改一下这段代码,或者看看哪里出问题了?小弟先谢谢了。
这一段运行时候就找不到对象是怎么回事?
a=.cells(i,65536).end(3)
if a <max then max=a
next
for i=1 to 10
.cells(max,1)="123456"
next
a=.cells(i,65536).end(3)
if a <max then max=a
next
for i=1 to 10
.cells(max,i)="123456"
next
a=.cells(i,65536).end(3)
if a <max then max=a
next
for i=1 to 10
.cells(max+1,i)="123456"
next