VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 编程开发 > vb >
  • excel vba教程之有条件连续输入递增数字

1.  有条件连续输入递增数字

(数组赋值)
Private Sub CommandButton1_Click()
'by:Northwolves
‘http://club.excelhome.net/dispbbs.asp?boardID=2&ID=250658&page=1&px=0
Dim arr(1 To 65536, 1 To 1), i As Long, j As Long, n As Long, arr2
Application.ScreenUpdating = False
arr2 = [a1].Resize([a65536].End(xlUp).Row, 1)    ‘数组赋值
For i = 1 To UBound(arr2)
For j = 1 To arr2(i, 1)
n = n + 1
arr(n, 1) = i
Next
Next
[b1:b65536] = arr
Application.ScreenUpdating = True
MsgBox "ok"
End Sub

相关教程