Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Setting Cells Equal only if Destination Cell Does Not Have a Formu
Is there a way in VBA to set a cell equal to another cell only if the
destination cell does not contain a formula (has a value)? Thanks Adam Bush |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Setting Cells Equal only if Destination Cell Does Not Have a Formu
Yes. Here we check A2 to make sure it has not formula:
Sub save_formula() Set a1 = Range("A1") Set a2 = Range("A2") If a2.HasFormula Then Else a2.Value = a1.Value End If End Sub -- Gary''s Student - gsnu200784 " wrote: Is there a way in VBA to set a cell equal to another cell only if the destination cell does not contain a formula (has a value)? Thanks Adam Bush |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Setting Cells Equal only if Destination Cell Does Not Have a F
Gary,
Thanks you very much. I did not know that hasformula was a property. Thanks Adam Bush "Gary''s Student" wrote: Yes. Here we check A2 to make sure it has not formula: Sub save_formula() Set a1 = Range("A1") Set a2 = Range("A2") If a2.HasFormula Then Else a2.Value = a1.Value End If End Sub -- Gary''s Student - gsnu200784 " wrote: Is there a way in VBA to set a cell equal to another cell only if the destination cell does not contain a formula (has a value)? Thanks Adam Bush |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I make a range of cells equal to one cell | Excel Discussion (Misc queries) | |||
Displaying 'IF' Function result (text) over cells containing formu | Excel Worksheet Functions | |||
Cells equal to another cell a certain # over | Excel Discussion (Misc queries) | |||
Setting a cell equal to another worksheet cell fails (sometimes) | Excel Worksheet Functions | |||
How do I make a cell equal to another cells value and not it's fo. | Excel Worksheet Functions |