iT邦幫忙

0

Excel增加「共用活頁簿」功能 VBS裡頭指令會消失!

  因我有增加如下的VBS指令,然後在Excel增加「共用活頁簿」功能後,VBS裡頭指令完全消失,請問這要如何克服?!

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect([A1:A2000,K1:K2000], Target) Is Nothing Then Exit Sub
'if target.count > 1 then exit sub '當 range 中的數量多於1個時離開
Application.EnableEvents = False
'Target = UCase(Target) '修改1個欄位時適用
'修改多個欄位時,需改成這樣
For Each c In Target.Cells
c.Value = UCase(c.Value)
Next
Application.EnableEvents = True
End Sub

尚未有邦友回答

立即登入回答