I wrote a function, where you put a column name as a string and row number. Then it goes to that cell and changes inside formula, let's say sheet1 to sheet2
But when I apply it, many times excel shuts down. What can be reason. Here's code
Public Function formchange( c As String, n As Integer, Optional valueLookFor As Variant, Optional valueChangeTo As Variant) As Variant
valueLookFOr ='sheet1'
condOne = ThisWorkbook.ActiveSheet.Range(c & n).Find(What:= valueLookFor)
valueChangeTo = 'sheet2'
If condOne <> 0 Then
ThisWorkbook.ActiveSheet.Range(c&n).Replace(valueLookFor,valueChangeTo).Select
End If
End Function