Hi,
i have added the following code to my worksheet_change event and getting the error while running this code on Excel 2007 but working well on Excel 2013.
Can any body help to solve the issue as i am trying to calculate the things for both column value change. The error message is as: "No Registered JIT debugger was specified"....
If someone has best suggestion to deal with please share or modify the code.
thanks
i have added the following code to my worksheet_change event and getting the error while running this code on Excel 2007 but working well on Excel 2013.
Can any body help to solve the issue as i am trying to calculate the things for both column value change. The error message is as: "No Registered JIT debugger was specified"....
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim TaxVal, TaxCode As String
Dim currentCell As Range
Dim TaxPercent As Double
TaxCode = "N"
On Error Resume Next
'Processing with J column
If Target.Column = 10 Then
If Target.Cells.Offset(0, 2).Value = "" Then
MsgBox "Tax Code Must be Entered", vbInformation, "Missing Tax Code"
Exit Sub
ElseIf Target.Cells.Offset(0, 3).Value = "" Or Target.Cells.Offset(0, 3).Value = 0 Then
TaxCode = Target.Cells.Offset(0, 2).Value
TaxPercent = CDbl(Application.VLookup(TaxCode, Sheets("TaxCode").Range("b3:d22"), 3, False))
Target.Cells.Offset(0, 1).Value = Target.Cells.Value * TaxPercent
Target.Cells.Offset(0, 3).Value = Target.Cells.Value + Target.Cells.Offset(0, 1).Value
End If
End If
'Processing with column 13
If Target.Column = 13 Then
If Target.Cells.Offset(0, -1).Value = "" Then
MsgBox "Tax Code Must be Entered", vbInformation, "Missing Tax Code"
Exit Sub
ElseIf Target.Cells.Offset(0, -3).Value = "" Or Target.Cells.Offset(0, -3).Value = 0 Then
TaxCode = Target.Cells.Offset(0, -1).Value
TaxPercent = CDbl(Application.VLookup(TaxCode, Sheets("TaxCode").Range("b3:d22"), 3, False))
If TaxPercent = 0 Then
Target.Cells.Offset(0, -2).Value = Target.Cells.Value * TaxPercent
Target.Cells.Offset(0, -3).Value = Target.Cells.Value - Target.Cells.Offset(0, -2).Value
Else
TaxPercent = TaxPercent + 1
Target.Cells.Offset(0, -3).Value = Target.Cells.Value / TaxPercent
TaxPercent = TaxPercent - 1
Target.Cells.Offset(0, -2).Value = Target.Cells.Offset(0, -3).Value * TaxPercent
End If
End If
End If
'End of Mian IF test
End Sub
thanks