這應該得用宏才能實現。右鍵點該工作表的名字(在工作簿左下方呢),檢視程式碼,貼上如下程式碼:Dim xAdd As DoublePrivate Sub Worksheet_Change(ByVal Target As Range)If Target.Range("A1").Column = 1 Then xAdd = Target.Range("A1") - xAddIf xAdd > 0 ThenApplication.EnableEvents = FalseTarget.Range("A1").Offset(0, 4) = Target.Range("A1").Offset(0, 4) + xAddApplication.EnableEvents = TrueEnd IfEnd SubPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)If Target.Range("A1").Column = 1 Then xAdd = Target.Range("A1")End Sub兩個粗體1表是A列(即第1列),兩個粗體4表示該列向右數的第4列,即D列。請自己按需修改。回到Excel,功能實現。
這應該得用宏才能實現。右鍵點該工作表的名字(在工作簿左下方呢),檢視程式碼,貼上如下程式碼:Dim xAdd As DoublePrivate Sub Worksheet_Change(ByVal Target As Range)If Target.Range("A1").Column = 1 Then xAdd = Target.Range("A1") - xAddIf xAdd > 0 ThenApplication.EnableEvents = FalseTarget.Range("A1").Offset(0, 4) = Target.Range("A1").Offset(0, 4) + xAddApplication.EnableEvents = TrueEnd IfEnd SubPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)If Target.Range("A1").Column = 1 Then xAdd = Target.Range("A1")End Sub兩個粗體1表是A列(即第1列),兩個粗體4表示該列向右數的第4列,即D列。請自己按需修改。回到Excel,功能實現。