View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Check to see if a formula is correct

Try

If Range("A1").Formula < "=B1+B2" Then
Range("A1").Formula = Range("C1").Formula
End If

--
Jacob


"oldjay" wrote:

I want to do something like this
Sub Macro1()

If Range("A1") =(=B1 + B2) Then ' This is a formula
Exit Sub
Else
Range("C1").Select 'Has correct formula
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlFormulas
End If

End Sub
How do I do this?