Private Sub Worksheet_Change(ByVal Target As Range)
Dim pwd As String
pwd = "123"
If Target.Address = "$A$1" And Target <> "" Then
Me.Unprotect pwd
Application.EnableEvents = False
Call test
Application.EnableEvents = True
Me.Protect pwd
End If
End Sub
'处理动作
Sub test()
For i = 37 To 39
If Len(Sheet1.Cells(3, i)) = 0 Then
Range(Cells(4, i), Cells(51, i)).ClearContents
Columns(i).Hidden = True
Else
Columns(i).Hidden = False
End If
Next i
Application.Dialogs(xlDialogSaveAs).Show
End Sub
月度销售流水2.rar
(22.24 KB, 下载次数: 24)