nagovind
Member
Dear all
Equation is V = I x R
V is in A1, I is in B1 and R is in C1
Aim is if i give any one of the input in any one of the cell then the corresponding other 2 values has to be changed
Below code is not working please help
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
V = Range("A1")
I = Range("B1")
R = Range("C1")
'equation is V = I x R
If Target.Row = 1 And Target.Column = 1 Then
Range("B1") = V / R
Range("C1") = V / I
GoTo k
End If
If Target.Row = 1 And Target.Column = 2 Then
Range("A1") = I * R
Range("C1") = V / I
GoTo k
End If
If Target.Row = 1 And Target.Column = 3 Then
Range("B1") = V / R
Range("A1") = I * R
Exit Sub
End If
k:
End Sub
Equation is V = I x R
V is in A1, I is in B1 and R is in C1
Aim is if i give any one of the input in any one of the cell then the corresponding other 2 values has to be changed
Below code is not working please help
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
V = Range("A1")
I = Range("B1")
R = Range("C1")
'equation is V = I x R
If Target.Row = 1 And Target.Column = 1 Then
Range("B1") = V / R
Range("C1") = V / I
GoTo k
End If
If Target.Row = 1 And Target.Column = 2 Then
Range("A1") = I * R
Range("C1") = V / I
GoTo k
End If
If Target.Row = 1 And Target.Column = 3 Then
Range("B1") = V / R
Range("A1") = I * R
Exit Sub
End If
k:
End Sub