+ Reply to Thread
Results 1 to 2 of 2

Using For Next Loop with Formulas

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Using For Next Loop with Formulas

    I'm trying to place subtotals 2 rows below the bottom row of several columns.

    I can't use the range function because the last row is variable. So I was trying the use the code below, but it just places the exact same formula in each columns instead of adjusting it by column the way the range function would. How should I be doing this?

    Please Login or Register  to view this content.

    Thanks!!

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Using For Next Loop with Formulas

    Hello,

    Here's a suggestion, using relative reference:

    for example, if you are in G20,
    R5C means, from Row5 in same column (G)
    R[-2]C means : 2 rows before (18) in same column (G)

    R5C:R[-2]C = G5:G18

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

+ 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] Loop through column A and put formulas
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-09-2015, 07:06 AM
  2. Copy, past, formulas, loop
    By Aftermaind in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-13-2014, 08:24 AM
  3. [SOLVED] Hide Formulas, Without Using Loop
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-18-2013, 12:46 PM
  4. Loop formulas
    By SalamanderSam14 in forum Excel General
    Replies: 1
    Last Post: 06-13-2012, 07:17 AM
  5. Sumproduct, three formulas ,or if loop?
    By Cyberpawz in forum Excel General
    Replies: 4
    Last Post: 03-21-2012, 09:15 AM
  6. Loop through column looking for formulas
    By squestio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2011, 08:45 AM
  7. [SOLVED] How do I set up a while loop for formulas?
    By frustrated in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2005, 08:05 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