+ Reply to Thread
Results 1 to 3 of 3

How do I place formula in cell using VBA with formula actually being placed in cell

  1. #1
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    How do I place formula in cell using VBA with formula actually being placed in cell

    I have been trying the following code to place a formula in a cell

    Please Login or Register  to view this content.
    This is just a test of my code to see if it worked which it didn't. What I am trying to do is place a formula in the range A20:A56 where each formula in each row will look at the adjacent cells in columns E:U if any of the cells in that row range is greater than or less than zero put "True" otherwise if all cells in that range equal zero put "False".

    Currently if I paste this formula in cell A22 it works and returns a "False" because none of the values in the range E22:U22 contain a number greater than or less than zero but if I run the code instead, it places "True" in the cell regardless of the values in the range all being zero. secondly, when I run the code it doesn't actually place the formula in the cell it places the solution in the cell and I was hoping to get the formula although if I can just get the formula to work that would be fine. Not sure if it matters but there are formulas in the range E:U that pull in a $value from a data set using a "Sumifs" formula. My end goal is, I'm just looking to place the above formula in the range of cells ("A20:A56") that looks at the adjacent "E:U" range and if any value within that range either contains a dollar value greater than $0 or less than $0 just put "True" but if all values within that range are all $0 put "False".

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How do I place formula in cell using VBA with formula actually being placed in cell

    Try

    Please Login or Register  to view this content.
    or you might need double double quotes

    Please Login or Register  to view this content.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    09-11-2014
    Location
    Eugene, Oregon
    MS-Off Ver
    MS EXCEL 2010
    Posts
    210

    Re: How do I place formula in cell using VBA with formula actually being placed in cell

    Thanks Special-K! It was the double quotes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 03-03-2014, 02:28 PM
  2. Replies: 0
    Last Post: 08-14-2012, 10:42 AM
  3. Replies: 4
    Last Post: 05-31-2012, 04:56 PM
  4. [SOLVED] Formula to place % in cell when value is less than 100
    By NickPDC in forum Excel General
    Replies: 2
    Last Post: 12-08-2010, 11:21 AM
  5. Replies: 1
    Last Post: 02-07-2005, 08:21 AM
  6. Is there a formula that will place the sheet name in a cell?
    By Reed in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-19-2005, 10:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1