+ Reply to Thread
Results 1 to 3 of 3

Trying to Write a Formula within a Cell that References Another Object

  1. #1
    Registered User
    Join Date
    09-27-2014
    Location
    Florida
    MS-Off Ver
    MS Office 2010
    Posts
    2

    Question Trying to Write a Formula within a Cell that References Another Object

    Hi! I've been lurking for some time, but am hoping I could get some help on a little conundrum. To summarize the problem, I am trying to write an "IF" formula within an ActiveCell that references the first cell of the ActiveCell's row and another cell defined by the location of the ActiveCell.

    So far, I've successfully defined all necessary objects, but now I need some help actually writing the formula within the cell. I've attached the code below. I would be grateful for any help or advice you could give me.

    Please Login or Register  to view this content.

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

    Re: Trying to Write a Formula within a Cell that References Another Object

    Hi and welcome to the forum.

    I think you want to concatenate the variable's value within the formula string.

    emptycell.FormulaR1C1Local = "=IF(RC[" & abcoffset & "]=RC[" & defoffset & "],0,1)"
    Last edited by AlphaFrog; 09-27-2014 at 05:18 PM.
    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.

  3. #3
    Registered User
    Join Date
    09-27-2014
    Location
    Florida
    MS-Off Ver
    MS Office 2010
    Posts
    2

    Re: Trying to Write a Formula within a Cell that References Another Object

    Thanks! This worked amazingly.

+ 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] Is it possible to write an IF statement containing multiple references to 2 other cells?
    By Karelia Suite in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-31-2013, 08:11 AM
  2. [SOLVED] Macro to write a formula with dynamic cell references
    By alpha608 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-27-2013, 12:18 PM
  3. Replies: 12
    Last Post: 06-20-2012, 01:53 PM
  4. Object References
    By gabch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-17-2006, 07:26 AM
  5. Object Library References
    By Fox via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-25-2006, 02:55 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