Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to leave a formula cell blank when it has no calculation to make Colin Hayes Excel Discussion (Misc queries) 9 May 13th 07 04:41 AM
How to make the current date appear when i click 'enter' in a cell Matt_07 Excel Worksheet Functions 1 January 30th 07 09:32 AM
After Creating New Tab I Hit <Enter, How Do I Make it Go Immediately to a Given Cell? [email protected] Excel Programming 2 September 18th 06 08:57 PM
How do I make someone enter information in a cell Vicky T Excel Discussion (Misc queries) 1 June 7th 06 05:45 PM
Make T=True in a cell, when I enter T A357Magnum Excel Worksheet Functions 3 January 20th 06 07:32 PM


All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"