+ Reply to Thread
Results 1 to 6 of 6

Adding in Formula using VBA

  1. #1
    Forum Contributor
    Join Date
    11-19-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    137

    Adding in Formula using VBA

    I'm looking for a way to paste in my formula =IFERROR(IF($J2="VSL",EDATE($K2+7,1),$K2+7),IF($K2="ETA TBD","ETA TBD")) if cell L2 has no value. Below I tried to use the following code but I get a Syntax Error when I try to run it.


    Please Login or Register  to view this content.
    Any help would be appreciated. Thanks

  2. #2
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Adding in Formula using VBA

    The Cells() relies on numbers only. So you should have something like

    Please Login or Register  to view this content.
    So in you case I'm not totally clear on where your I comes in but I think it would look something like

    Please Login or Register  to view this content.
    With 12 being column L

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Adding in Formula using VBA

    To indicate literal quotes within a string, use two consecutive quotes for each literal quote.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Adding in Formula using VBA

    Cells also take column letter
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Adding in Formula using VBA

    Yes I apologize I meant to clarify that you are supposed to split up row and column references. At least as far as my experience has shown me you can not reference a row and then "l2" as done above.

  6. #6
    Forum Contributor
    Join Date
    11-19-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    137

    Re: Adding in Formula using VBA

    Thank you Jin & Alpha this solved it!

+ 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. Adding a Date Formula to existing formula
    By bdav1216 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-12-2016, 08:21 PM
  2. [SOLVED] Adding a date formula to an existing formula
    By amasson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-18-2014, 04:20 PM
  3. [SOLVED] Formula for adding a percentage from one cell and adding the total of 2 others
    By Kandra in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-04-2013, 06:48 AM
  4. adding Indirect formula to my current sum if array formula
    By Eastbay2 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-13-2013, 09:41 AM
  5. Replies: 1
    Last Post: 02-24-2013, 06:27 PM
  6. [SOLVED] Adding a match formula to an existing formula
    By pauldaddyadams in forum Excel General
    Replies: 8
    Last Post: 08-16-2012, 05:14 PM
  7. Replies: 8
    Last Post: 03-21-2012, 12:04 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