Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With Sh
If Target.Address = "$F$2" And IsDate(Target) Then
Application.EnableEvents = False
Select Case Format(.[F2], "m/d")
Case "1/1"
x = "王小明"
Case "1/2"
x = "李小華"
Case "1/3"
x = "張小美"
End Select
.[N3] = x
Application.EnableEvents = True
End If
End With
End Sub
複製代碼
作者: united7878 時間: 2010-12-30 05:27
謝謝大大的指導~有了語法果然免去逐一套用函數的步驟,
但在thisworkbook模組下是否會套用到全工作表?如要選定某表可以嗎?
還有如何大量又快速編輯語法內的對照data?
Case "1/1"
x = "王小明"
Case "1/2"
x = "李小華"
Case "1/3"
x = "張小美"