+ Reply to Thread
Results 1 to 4 of 4

Increment Cell Reference

  1. #1
    Registered User
    Join Date
    09-11-2009
    Location
    MN
    MS-Off Ver
    Office 2010
    Posts
    48

    Increment Cell Reference

    I have a worksheet that contains the days of the week (Mon, Tues, etc...) in B4:B10. In C4:G10 these cells = a cell on other sheets.

    Each week I have to go in and manually change each cell reference to look at the next row down on the sheet they pull from. Is there a way that I can set it so that when I push a command button, it will just increment the cell reference row by one?

    Example: C4 is ='3rd'!B23
    I would like to push a button so that C4 is ='3rd'!B24
    Last edited by XLVBA; 05-08-2012 at 08:34 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Increment Cell Reference

    Try

    Please Login or Register  to view this content.
    This will increment the formulae on selected cells.

    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.
    Martin

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Increment Cell Reference

    I would use formula rather than macro for this.

    Assuming it is always the last row you want.

    Example: C4 is ='3rd'!B23. Change that to

    =OFFSET('3rd'!B1,COUNTA('3rd'!B:B)-1,0,1,1)

    I hope some version of the above formula helps you with your need.
    Last edited by vandan_tanna; 05-07-2012 at 05:15 PM. Reason: Clarification

  4. #4
    Registered User
    Join Date
    09-11-2009
    Location
    MN
    MS-Off Ver
    Office 2010
    Posts
    48

    Re: Increment Cell Reference

    Mrice: The macro worked beautifully! Thank you! In some cases I also needed it to jump down 7 rows, but simply changing the 1 to a 7 took care of that as well.
    Thanks Vandan; but it's not always the last row.

+ 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