+ Reply to Thread
Results 1 to 6 of 6

Need Worksheet Formula Corrected to use for VBA Macro

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2010
    Posts
    34

    Need Worksheet Formula Corrected to use for VBA Macro

    This formula works correctly in my spreadsheet but now I need to add it to a macro and this format will not work in VBA:

    =SUMIFS($F:$F,$K:$K,"FC MNT",$M:$M,"")+SUMIF($K:$K,"FC MNT",$N:$N)

    It sums the cells in column F, if column K contains the word "FC MNT" and if column M is blank; then it adds the sum of column N if column K contains "FC MNT.

    I'm sure there is a better way to create the formula but this was the best way I could get it to work. Please let me know if you need more info.

    Thanks,

    Debbie

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Need Worksheet Formula Corrected to use for VBA Macro

    are you trying to put that formula in a cell using vba or trying to replicate its function in code?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    07-10-2013
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Need Worksheet Formula Corrected to use for VBA Macro

    I'm trying to replicate it's function in code.

  4. #4
    Registered User
    Join Date
    07-10-2013
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Need Worksheet Formula Corrected to use for VBA Macro

    WAIT! I think I replied to quickly....give me a couple of minutes to think about it.

  5. #5
    Registered User
    Join Date
    07-10-2013
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Need Worksheet Formula Corrected to use for VBA Macro

    Okay - I'd like the code to insert the formula in cell L2. I was going to add "Range("L2").Formula = " to the front of the code, once someone replied.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Need Worksheet Formula Corrected to use for VBA Macro

    Please Login or Register  to view this content.
    note the doubled-up quotes

  7. #7
    Registered User
    Join Date
    07-10-2013
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Need Worksheet Formula Corrected to use for VBA Macro

    AWESOME, JOSIE!

    Thank you SO much for the quick response! I knew about the double-quotes (from examples of other formulas people here have helped me with) but I just couldn't figure out how to place all the data properly.

    Thank you so much!

    Debbie

+ 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. Corrected: Need help with input Box variable
    By ybortony in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2012, 03:33 AM
  2. Calculating a corrected forecast
    By saved1ne in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2012, 11:07 AM
  3. [SOLVED] Combining columns corrected
    By jezzica85 in forum Excel General
    Replies: 2
    Last Post: 03-11-2006, 08:30 AM
  4. IF AND question corrected
    By Lee in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Array formula reference (Corrected)
    By JAK in forum Excel General
    Replies: 4
    Last Post: 02-22-2005, 12:06 AM

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