I have a range in sheet 7, Range("A1:A10"), I am trying below code to get a percentange value in the same Cell, but the Excel hung up whenever i type a number in Range("A1:A10"), and sometime, It gives me a runtime error "28" out of stack space. but can't show any line number or highlight the line.
I am trying this for example
If i type any number in the range A1 to A10, For example 1499 in cell A2, the Value should be change to 1338.46 in cell A2 (Same Cell), Because 1338.46 is 89.29% of 1499.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngCell As Range, m, v
For Each rngCell In Range("A1:A10")
v = rngCell.Value
If Len(v) > 0 Then
m = v * 89.29 / 100
If Not IsError(m) Then rngCell.Value = m
End If
Next
End Sub