Sub test() Dim tj(1 To 15, 1 To 2) '声明数组,保存条件数据 Dim wb(23 To 861, 1 To 1) '声明数组,保存程序结果 Dim m%, nRow%, cTxt$ For i = 1 To 15 '循环1至15行 tj(i, 1) = Array(271, 301, 329, 360, 413, 430, 458, 483, 575, 612, 646, 675, 758, 789, 861)(i - 1) '给数组赋值 tj(i, 2) = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O")(i - 1) Next For i = 23 To 861 Step 20 '循环 If nRow < i Then m = m + 1 '计数器,记录当前应用条件数组(tj)的一维变量(行) nRow = tj(m, 1) '行号 cTxt = tj(m, 2) '文本 End If wb(i, 1) = cTxt Next Me.Range("a23:a861") = wb End Sub
bGZja1s8.zip
(18.38 KB, 下载次数: 188)
|