+ Reply to Thread
Results 1 to 4 of 4

IF statement for Sheet.Range.Formula

  1. #1
    Registered User
    Join Date
    05-27-2015
    Location
    Minnesota
    MS-Off Ver
    2010
    Posts
    19

    IF statement for Sheet.Range.Formula

    I have the following macro code set up

    Please Login or Register  to view this content.
    Sheet 1 is called Scripts FYI

    For a few of the formulas I want to implement an IF statement, but I get an error.

    For example, for range B3:B, I want the formula
    Please Login or Register  to view this content.
    Is there a correct way of including IF statements into the code without causing errors? Or is there a more efficient macro which can be implemented that I overlooked?

    Thanks for any assistance.

  2. #2
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: IF statement for Sheet.Range.Formula

    Hi,

    Can you please add an excel that shows what you need exactly?
    I think you can use a R1C1 formula.

    The macro looks right, and post also the error you have.

    Thanks,
    Ionut

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: IF statement for Sheet.Range.Formula

    If you are trying to put that formula into a cell using code then you need to double up the quotes.

    For example.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    05-27-2015
    Location
    Minnesota
    MS-Off Ver
    2010
    Posts
    19

    Re: IF statement for Sheet.Range.Formula

    Quote Originally Posted by Norie View Post
    If you are trying to put that formula into a cell using code then you need to double up the quotes.

    For example.
    Please Login or Register  to view this content.
    It was the double quotes issue, which I completely overlooked. Thank you for this!

+ 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. [SOLVED] Add IF Statement formula to cells in varying range and paste to used range
    By Webbers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2015, 01:28 PM
  2. Formula to pull data from one sheet to a new sheet based on date range
    By lisajolley11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2015, 08:38 PM
  3. Replies: 1
    Last Post: 11-07-2014, 01:42 PM
  4. [SOLVED] VBA Code: how to use merged cell as range for a If and Formula statement
    By Acosta in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-04-2014, 03:12 PM
  5. statement / formula to return text from a range of cells
    By nellyc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-30-2013, 07:55 AM
  6. If statement formula for range not changing requested cell to yes
    By Exceldope in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-20-2012, 12:14 PM
  7. [SOLVED] Fix range in formula and range refer to other sheet
    By DavidRoger in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-22-2012, 11:51 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