0

I have a form that I need to have change when the data is entered. Tough to explain but this is the best way I can describe my situation:

A b
1 .5 10
2 .5 5
3 The end user will be entering 10 in b1 and I want it to change to 5 as they enter it. I can not alter the columns as this is set form.

Any ideas? Thank you.

Sorry I can not figure out the formatting...

4

1 回答 1

0

您可以在工作表代码中添加一些这样的内容:

Private Sub Worksheet_Change(ByVal Target As Range)


If Target.Address = Range("B1").Address Then

    If Range("B1") = 10 Then

        Range("B1").Value =  5

    Else

        Range("B1").Value = 5

    End If

End If


End Sub
于 2013-02-11T12:09:20.313 回答