What is VBA?
Example:
Sub HelloWorld()
MsgBox "Hello, World!"
End Sub
保存以便复习
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。
了解热门 VBA 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
了解热门 VBA 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。
搜索问题以查看答案。
Example:
Sub HelloWorld()
MsgBox "Hello, World!"
End Sub
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Dim myVar As String
myVar = "Hello"
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets(1)
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Dim cell As Range
For Each cell In Range("A1:A10")
Debug.Print cell.Value
Next cell
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
'Option Explicit
Sub Example()
Dim x As Integer
y = 10 ' This will cause an error without 'Option Explicit'
End Sub
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Sub Example()
If condition Then
Exit Sub
End If
' Rest of the code
End Sub
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Sheets.Add After:=Sheets(Sheets.Count)
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
If x > 10 Then
Debug.Print "x is greater than 10"
ElseIf x < 10 Then
Debug.Print "x is less than 10"
Else
Debug.Print "x is equal to 10"
End If
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Do While i < 10
Debug.Print i
i = i + 1
Loop
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Const PI As Double = 3.14159
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
On Error Resume Next
' code that may cause an error
On Error GoTo 0
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
For i = 1 To 10
Debug.Print i
Next i
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
MsgBox "Hello, World!", vbInformation + vbOKOnly, "Greeting"
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Call MyProcedure()
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Dim myArray(1 To 3) As Integer
myArray(1) = 10
myArray(2) = 20
myArray(3) = 30
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Dim userInput As String
userInput = InputBox("Enter your name:", "User Input")
收藏此条目、标记为困难题,或将其加入复习集合。
Example:
Application.ScreenUpdating = False
' Your code here
Application.ScreenUpdating = True
收藏此条目、标记为困难题,或将其加入复习集合。