Put this in your worksheet code module (right-click the worksheet tab
and choose View Code):
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Cells.Count > 1 Then Exit Sub
If .Address(False, False) = "B2" Then
If IsNumeric(.Value) Then
On Error Resume Next
Application.EnableEvents = False
.Value = -.Value
Application.EnableEvents = True
On Error GoTo 0
End If
End If
End With
End Sub
One way is to type a "-" in front of the number just before you move the
cursor. Or you can veiw this site to get some ideas on how to use the
SelectionChange event.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.