<   Excel VBA實務班(第二班)測驗(全部95題任選25題)   >

免費免註冊,彰化一整天線上測驗:http://exam.bestdaylong.com/test2226.htm

( )1. 使用debug.print rnd(1)不可能產生那一個數字(1)0 (2)0.99 (3)0.5 (4)1
( )2. 程式碼如下

sub test()
    Dim i As Integer
    
    For i = 1 To 10
        Cells(i + 1, 1).Value = 11 - i
    Next i

end sub(1)在儲存格D2:D11顯示10到1的數字 (2)在儲存格A2:A11顯示10到1的數字 (3)在儲存格B2:B11顯示10到1的數字 (4)在儲存格C2:C11顯示10到1的數字
( )3. 底下程式執行時會在即時視窗顯示什麼
Sub test3()
    Dim no As Variant
    no = Array(1, 2, 3, 4, 5)
    Debug.Print UBound(no)   '顯示陣列最大索引值
End Sub(1)3 (2)4 (3)5 (4)0
( )4. 在Excel VBA的中斷模式時,按那一個按鈕可以逐一行執行(1)F5 (2)shift+F8 (3)Ctrl+Shift+F9 (4)F8
( )5. 請問此圖程式執行結果(1)在變數i<5時會中斷程式 (2)在變數i>5時會中斷程式 (3)在變數i不等於5時會中斷程式 (4)在變數i=5時會中斷程式
( )6. 在Excel VBA中小於等於的符號是(1)=< (2)>= (3)=> (4)<=
( )7. 工作表如圖,若執行底下程式會顯示什麼?
Sub test4()
    Dim i As Integer
    
    i = 1
    
    Do While Cells(i + 1, 2).Value <> ""
       i = i + 1
    Loop
    
    MsgBox Cells(i, 2).Value

End Sub
(1)68 (2)0 (3)37 (4)63
( )8. 圖中的數字6代表(1)cell (2)workbook (3)worksheet (4)range
( )9. 底下程式碼執行結果會在即時視窗出現
Sub test4()
    Dim i, n As Integer
    
    n = 0
    
    For i = 5 To 1 Step -1
       n = n + 1
       i = i - 1
    Next i
    Debug.Print n & "," & i
    
End Sub(1)5,0 (2)5,-2 (3)3,0 (4)3,-1
( )10. 底下程式執行時會在即時視窗顯示什麼
Sub test7()
    Dim i As Integer
    Dim std_no(5) As Integer
    
    For i = 1 To 5
        std_no(i - 1) = i - 1
    Next
    
    Debug.Print std_no(3)   '顯示陣列索引為3的資料
End Sub(1)1 (2)2 (3)3 (4)4
( )11. 為了使亂數每次產生的都不一樣,可以在產生亂數前加入那一個指令(1)rand (2)randomize (3)int (4)dim
( )12. 使用array函數建立陣列,型別必須為(1)variant (2)int (3)string (4)date
( )13. 在Excel中工作表的英文名稱為(1)Application (2)workbook (3)worksheet (4)excel
( )14. 在Excel VBA中要顯示一段文字hello那一段語法是對的(1)msgbox "hello" (2)say "hello" (3)say hello (4)msgbox hello
( )15. 在Excel VBA中列的英文為(1)column (2)cell (3)x (4)row
( )16. 在Excel VBA中物件方法的圖示為(1) (2) (3) (4)
( )17. 變數的命名規則(1)以上皆是 (2)第一個字元需英文字母 (3)變數名稱不可包含空白、點、,逗號或其他特殊字元 (4)變數名稱不可為關鍵字,例如for、next、while、public等
( )18. 底下程式碼執行結果會在即時視窗出現
Sub test5()
    Dim i, n As Integer
    
    n = 0
    
    For i = 1 To 10
       
       If i Mod 3 = 1 Then
          n = n + 1
       End If
       
    Next i
    
    Debug.Print n & "," & i
    
End Sub(1)4,10 (2)5,10 (3)4,11 (4)3,10
( )19. 圖中的數字3代表(1)cell (2)row (3)column (4)range
( )20. 程式碼如下
For i= 1 to 10 
      cells(i,1).value=i
Next i
此程式的執行結果?(1)在儲存格A1:A10填入1到10 (2)在儲存格A1:A10都顯示1 (3)在儲存格A1:J1填入1到10 (4)在儲存格A1:J1填入1到1
( )21. 工作表如圖,若執行底下程式會顯示什麼?
Sub test10()
    Dim i As Integer
    
    i = 1
    
    Do While Cells(6, i).Value <> ""
       i = i + 1
    Loop
    
    MsgBox i

End Sub(1)3 (2)4 (3)1 (4)2
( )22. 在Excel VBA的即時視窗輸入 print 1 & 2 & 3 請問會顯示(1)6 (2)123 (3)0 (4)1+2+3
( )23. 圖中的數字5代表(1)row (2)column (3)range (4)cell
( )24. 底下程式執行時會在即時視窗顯示什麼
Sub test4()
    Dim std_no As Variant
    no = Split("國文,英文,數學,理化", ",")
    Debug.Print no(3)   '顯示陣列索引為3的資料
End Sub(1)數學 (2)理化 (3)國文 (4)英文
( )25. 在Excel VBA中變數的宣告要使用那一個指令(1)dim (2)let (3)print (4)set

解答:
001.【4】002.【2】003.【2】004.【4】005.【4】006.【4】007.【4】008.【3】009.【4】010.【3】
011.【2】012.【1】013.【3】014.【1】015.【4】016.【2】017.【1】018.【3】019.【3】020.【1】
021.【4】022.【2】023.【1】024.【2】025.【1】

詳解: