列中的每个新值自动乘以 X

Every New Value in a Column to Automatically Multiply by X

在电子表格中,我试图以某种方式使输入到 D 列单元格中的任何新数值乘以 85%。基本上,如果我转到 D 列中的任何单元格 2-100,000 并输入一个数值,我希望它自动显示它的 85%。

如果我在 D5 中输入“100”,我希望它显示“85”。

如果我在 D317 中输入“200”,我希望它显示“170”。

这有可能以任何方式做到吗?

无法使用手动乘以另一个单元格或乘以 0.85。

非常感谢!

工作表更改:修改列中的任何输入

Sheet 模块例如Sheet1

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim irg As Range
    With Range("D2") ' from 'D2' to the bottom-most row:
        Set irg = Intersect(.Resize(Rows.Count - .Row + 1), Target)
    End With
    If irg Is Nothing Then Exit Sub
    
    Application.EnableEvents = False
    
    Dim iCell As Range
    For Each iCell In irg.Cells
        If IsNumeric(iCell.Value) Then
            iCell.Value = 0.85 * iCell.Value
        End If
    Next iCell
    
    Application.EnableEvents = True

End Sub