+ Reply to Thread
Results 1 to 9 of 9

Formula Placement

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Formula Placement

    Okay, this should be an easy one, but I'm not seeing it. I have a table of varying width. The last column of the table has the title of "Grand Total" in row 4, unknown column. I want to paste a formula in the cell one down and one right of "Grand Total" ("R1C1"), all the way to the bottom row of my table. The formula should pick up the value in the cell one to the left of and below "Grand Total" (R1C-1) through the end of the table and add that to the value in A5.

    My code I usually use (below) won't work in this situation because I don't know what columns to use, and I don't know what formula to fill in.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Formula Placement

    Okay, I figured out part of the solution. In the code below the line beginning with "Lastrow" determines the last row of the table. The line beginning with "Range" pastes what I want in the cell to the right of and one below "Grand total".

    Please Login or Register  to view this content.
    Two things still to do:
    1) I need to figure out how to combine the two lines so it pastes the formula all the way down to the bottom of my table.
    2) I still need to figure out the formula to use

    I'll keep plugging away, but I sure could use some help on this.

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Formula Placement

    Could you attach a small workbook. May be just me but I find it hard to visualise things like this, I know others don't.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,997

    Re: Formula Placement

    If I understood your post, isn't the formula:
    =RC[-1]+R5C1
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Formula Placement

    late to the party, but... my interpretation of your post
    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Formula Placement

    Sure. Workbook attached.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Formula Placement

    Still not quite I understand, and the guys above may have nailed it already, but here is my stab:
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Formula Placement

    And Palmetto wins the prize! Great piece of work there. I had to make one small change, changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Look at my sample workbook and you'll see why.

    Now, to complicate it even more, in the cells to the right of the cell we just populated I want to add the value from column A to the value we just plugged in, going out anywhere from 2 to 10 columns. Can we do that?

  9. #9
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,065

    Re: Formula Placement

    StephenR,

    I tried your code, and it almost works. It posted the correct results, but in the last column with a heading, instead of the column following "Grand Total". See, "Grand Total" isn't the last title in row 4. I tried changing your 4 to a 5 and ran the macro, but there was no result. I changed it back to a 5, and it repeated the first behaviour.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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