Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Make VBA Enter Formula into cell rather than calculation
How would I make say Cell C1's value be "A1+B1",
rather than the caluculation of A1+B1 i.e. 4 Don't want the number 4 to show in the formula bar. Because I'd like to autofill the formula and not the number 4 down the column of a similiar calculation. I'd like to learn how to code something like that. Then I can apply it to several different macros I have. I want VBA to enter the formula into a cell rather than the resulting answer.. is this possible? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Make VBA Enter Formula into cell rather than calculation
With numbers in colA and B the below code will assign the formula A+B in ColC
.. Try with dummy data in ColA and ColB... Sub Macro() Dim rngData As Range Set rngData = Range("C1:C" & Cells(Rows.Count, "A").End(xlUp).Row) rngData.Formula = "=A1+B1" End Sub If this post helps click Yes --------------- Jacob Skaria "Benjamin" wrote: How would I make say Cell C1's value be "A1+B1", rather than the caluculation of A1+B1 i.e. 4 Don't want the number 4 to show in the formula bar. Because I'd like to autofill the formula and not the number 4 down the column of a similiar calculation. I'd like to learn how to code something like that. Then I can apply it to several different macros I have. I want VBA to enter the formula into a cell rather than the resulting answer.. is this possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to leave a formula cell blank when it has no calculation to make | Excel Discussion (Misc queries) | |||
How to make the current date appear when i click 'enter' in a cell | Excel Worksheet Functions | |||
After Creating New Tab I Hit <Enter, How Do I Make it Go Immediately to a Given Cell? | Excel Programming | |||
How do I make someone enter information in a cell | Excel Discussion (Misc queries) | |||
Make T=True in a cell, when I enter T | Excel Worksheet Functions |