반응형
Excel에서 특정 셀이 변경될 때 매크로 실행
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Call Mymacro
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:B100")) Is Nothing Then
Call Mymacro
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("A1:C10")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
MsgBox "Cell " & Target.Address & " has changed."
End If
End Sub
반응형
'VBA' 카테고리의 다른 글
반복문(for...next, do while ...loop) (0) | 2022.02.17 |
---|---|
if문 (0) | 2022.02.17 |
VBA's Built-in Data Types (0) | 2021.12.29 |
Range 개체에 적용할 수 있는 몇 가지 방법 함수 프로시저에서 사용할 수 있는 항목 (0) | 2021.12.29 |
VBA Information 함수 일부 (0) | 2021.12.29 |