+ Reply to Thread
Results 1 to 4 of 4

Multi-argument IF formula VBA

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    Vancouver, CA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Multi-argument IF formula VBA

    Hi,
    Simple code below. Just trying to insert an IF formula via VBA in a cell that I can later autofill. Keep getting an error on this and don't know why.

    Thanks!

    Range("Q3").Formula = "=If (Range(""A3"").Value = Range(""A4"").Value And Range(""Q3"") = """" Then Range(""Q3"").Value = Range(""Q2"").Value)"
    Last edited by vba struggler; 06-21-2013 at 02:10 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: Troubleshoot easy formula code

    Hi, vba struggler,

    first of all youŽll create a circuital reference for the formula you try to insert, second you would need to exclude the ranges from the formula text.

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,052

    Re: Troubleshoot easy formula code

    Hi and welcome to the forum

    We would love to help you with your question, but 1st, in accordance with forum rules, please rename your thread to something more meaningful, that actually describes your problem.

    Because thread titles are used in searching the forum it is vital they be written to accurately describe your thread content or overall objective using ONLY search friendly key words. That is, your title used as search terms would return relevant results.

    Many members will look at a thread title, and if it is of interest to them, or it falls within their area of expertise, they might only open those threads.

    Look at it this way...if you typed that title into google, what would you expect to get back?

    To change a Title on your post, click EDIT on you're 1st post, then Go Advanced and change your title
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    05-09-2013
    Location
    Vancouver, CA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Multi-argument IF formula VBA

    Figured it out---thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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