Martin_H
Board Regular
- Joined
- Aug 26, 2020
- Messages
- 190
- Office Version
- 365
- Platform
- Windows
Hi team,
I would like to add CODE_1 in front of CODE_2 but not sure how to do it.
It has to be merged into one macro, under the Private Sub Worksheet_Change(ByVal Target As Range)
TY for help!
I would like to add CODE_1 in front of CODE_2 but not sure how to do it.
It has to be merged into one macro, under the Private Sub Worksheet_Change(ByVal Target As Range)
VBA Code:
'CODE_1
If ThisWorkbook.Name = "NAME.xlsm" Then
run CODE_2
Else
Exit Sub
End If
VBA Code:
'CODE_2
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$1" Then
With Application
.ScreenUpdating = False
With Worksheets("ABC")
.Unprotect "PASSWORD123"
Call FILTER
Call ADD_DROP_DOWN_LIST
.protect "PASSWORD123"
End With
.ScreenUpdating = True
End With
End If
End Sub
TY for help!