Sub 雙循環(huán)()
Dim i, j
For i = 1 To 9
For j = 1 To 9
If i >= j Then
Cells(i, j) = j & "*" & i & "=" & i * j
End If
Next
Next
End Sub
做個乘法表[開心]
學習達人
|
mevolf
展開
Sub 雙循環(huán)()
Dim i, j
For i = 1 To 9
For j = 1 To 9
If i >= j Then
Cells(i, j) = j & "*" & i & "=" & i * j
End If
Next
Next
End Sub
做個乘法表[開心] 且行且止123
展開
@ mevolf Sub 雙循環(huán)()
'循環(huán)語句里面再嵌套一個循環(huán)
Dim i, j
Range("A1:I9").ClearContents
For i = 1 To 9
For j = 1 To 9
If i < j Then
Cells(i, j) = ""
Else
Cells(i, j) = i & "X" & j & "=" & i * j
End If
Next
Next
End Sub |
承擔因您的行為而導致的法律責任,
本站有權(quán)保留或刪除有爭議評論。
參與本評論即表明您已經(jīng)閱讀并接受
上述條款。