+ Reply to Thread
Results 1 to 3 of 3

How to add an integer to R1C1 formula?

  1. #1
    Registered User
    Join Date
    05-08-2020
    Location
    Budapest, Hungary
    MS-Off Ver
    O365
    Posts
    7

    Angry How to add an integer to R1C1 formula?

    Hi Guys,

    I'm relatively new in VBA programming, that's why I need some help.

    I'm using the following macro, but it doesn't work (I guess because of the reference to the "lastrow" variable).
    I have two worksheets: the first one is "value", where I want to read data from to the other worksheet "May".

    Please Login or Register  to view this content.
    The problem is, that I do not know how to refer to the lastrow variable.
    I tried various forms (R"&lastrow&"; R" & lastrow & ") etc., but it didn't work.

    Any suggestions or advice?

    A friend of mine suggested to use the Application.Worksheetfunction.If formula, but I don't know how and where to insert it.

    Thanks a lot,
    Last edited by farkasmate; 05-08-2020 at 06:34 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to add an integer to R1C1 formula?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    I assume the asterisks in the formula are not really multiplication signs.

    Please Login or Register  to view this content.
    Would then give you a formula like this
    =+IF(D$1=Value!$M$4,SUMIFS(Value!$G$1:$G$2,Value!$A$1:$A$2,"2020",Value!$B$1:$B$2,"05",Value!$F$1:$F$2,"A",Value!$E$1:$E$2,May!$A2),"")
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    05-08-2020
    Location
    Budapest, Hungary
    MS-Off Ver
    O365
    Posts
    7

    Re: How to add an integer to R1C1 formula?

    Hi Andy,

    Thanks much - I didn't know why that was not working to me, I also tried to put " & lastrow & " into the formula, but got an error message.

    Now it Works fine

    Thank you

+ 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] Help with R1C1 formula
    By kmlloyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2015, 03:52 PM
  2. Using R1C1 formula in VBA changes all references from CELL("address") function to R1C1?
    By dmasters4919 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2014, 04:17 PM
  3. [SOLVED] Help with R1C1-formula
    By torppo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-06-2014, 08:52 AM
  4. Replies: 2
    Last Post: 06-30-2013, 03:30 PM
  5. [SOLVED] Need to Convert Formula R1C1 into A1-style but the Formula String exceeds 255 characters
    By VBA_Gary in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-04-2012, 12:09 PM
  6. Replies: 3
    Last Post: 10-27-2011, 05:20 PM
  7. Count the number of occurrences of an integer withing a larger integer
    By nnktran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2010, 01: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