I need a macro to write the value 500 from A1 formula.
For example:
- If A1 fórmula is =R10, then macro should write value 500 in R10
- If A1 fórmula is =J30, then macro should write value 500 in J30
Is it possible to do this?
Thanks a lot!
I need a macro to write the value 500 from A1 formula.
For example:
- If A1 fórmula is =R10, then macro should write value 500 in R10
- If A1 fórmula is =J30, then macro should write value 500 in J30
Is it possible to do this?
Thanks a lot!
I cant for the life of me think why you would want to do that but:[VBA]Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1").HasFormula Then
Range(Right(Range("A1").Formula, Len(Range("A1").Formula) - 1)) = 500
End If
End Sub[/VBA]
Regards,
Simon
Please read this before cross posting!
In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
If I have seen further it is by standing on the shoulders of giants.
Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)