VBA 学习

 

 


Sub
MyTest() 'A 列?B列的演示 Dim i As Long i = 1 While True If i > 10 Then GoTo ENDLOOP Cells(i, 1) = 1 If i Mod 2 = 0 Then GoTo Nextloop1 Cells(i, 2) = i * i Nextloop1: i = i + 1 Wend ENDLOOP: '在C列、D列的演示 For i = 1 To 10000 If i > 10 Then Exit For '或 if i > 10 then exit sub Cells(i, 3) = i If i Mod 2 = 0 Then GoTo nextloop2 '中断当前循环 Cells(i, 4) = i * i nextloop2: Next End Sub

 ActiveCell属性不是属于sheet的

 

posted @ 2019-11-03 18:05  蜡哲图  阅读(192)  评论(0编辑  收藏  举报
目录内容