Explain the difference between 'ByVal' and 'ByRef' in VBA.
Example:
Sub ModifyValue(ByRef x As Integer)
x = x + 1
End Sub
복습용 저장
복습용 저장
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.
Know the top VBA interview questions and answers for freshers and experienced candidates to prepare for job interviews.
Know the top VBA interview questions and answers for freshers and experienced candidates to prepare for job interviews.
Search a question to view the answer.
Example:
Sub ModifyValue(ByRef x As Integer)
x = x + 1
End Sub
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
On Error Resume Next
' code that may cause an error
On Error GoTo 0
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
With Range("A1")
.Value = 42
.Font.Bold = True
End With
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
ActiveCell.Value = "Hello"
Selection.Font.Bold = True
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Sub ShowUserForm()
UserForm1.Show
End Sub
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Application.ScreenUpdating = False
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
' Code to execute when cells in A1:A10 are changed
End If
End Sub
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Select Case x
Case 1
Debug.Print "Value is 1"
Case 2
Debug.Print "Value is 2"
Case Else
Debug.Print "Value is neither 1 nor 2"
End Select
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
ActiveCell.Offset(1, 2).Value = "Data"
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Unload UserForm1
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Dim myArray(1 To 10) As Integer
Debug.Print LBound(myArray) ' Outputs 1
Debug.Print UBound(myArray) ' Outputs 10
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
Example:
Function AddNumbers(x As Integer, y As Integer) As Integer
AddNumbers = x + y
End Function
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.