Thread: negative number
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default negative number

One way:

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


In article ,
enyaw wrote:

How do i set up that when i exit cell B2 that the number will change to a
negative number??