Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check to see if a formula is correct
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check to see if a formula is correct
Hi
Try Sub Macro1() If Range("A1").HasFormula Then Exit Sub Else Range("C1").Copy Range("A1").PasteSpecial Paste:=xlFormulas Application.CutCopyMode = False End If End Sub Regards Roger Govier 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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check to see if a formula is correct
Thanks
"Jacob Skaria" wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dup check 2 columns - need it to delete correct one | Excel Worksheet Functions | |||
Need to check if the value in one cell is correct or not | Excel Programming | |||
Check inputbox enter is in correct format | Excel Programming | |||
What's the correct format to check the name of a sheet? | Excel Programming | |||
How to correct this formula and check if more issues are existing? | Excel Programming |