+ Reply to Thread
Results 1 to 5 of 5

Trying to increase cell value by 1

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2015
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    2013
    Posts
    10

    Trying to increase cell value by 1

    I want to increase the cell value by 1 as you go down. So for example, if cell A1 is 1, I want cell A10 to be 2, Cell A20 to be 3, and so on. There needs to be a gap between them, not necessarily by 10 rows, but it needs to be there. Also, I need this to be a macro that can go on for about 300 or so of these increases.

    Thanks.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Trying to increase cell value by 1

    You could enter 1 in A1 and leave A2:A9 empty, then select A1:A9 and drag down.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-04-2015
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    2013
    Posts
    10

    Re: Trying to increase cell value by 1

    That wont work as there is other data and formatting in the cells in between. Essentially I have "pages" that will be printed. They are 36 rows each and the 5th row, column J will be the day (and each page will have it's own day) and thus needs to incrementally increase per each page.

  4. #4
    Registered User
    Join Date
    06-04-2015
    Location
    Milwaukee, Wisconsin
    MS-Off Ver
    2013
    Posts
    10

    Re: Trying to increase cell value by 1

    "Sub Incrementtesting()
    '
    ' Incrementtesting Macro
    '

    '
    Range("J42").FormulaR1C1 = "=R[-38]C+1"
    Range("J80").FormulaR1C1 = "=R[-38]C+1"
    Range("J118").FormulaR1C1 = "=R[-38]C+1"
    Range("J156").FormulaR1C1 = "=R[-38]C+1"
    End Sub"


    This is what I have written so far. That takes care of the first 5 pages, but I need it to do this for about 200+ pages, but I don't want to make this into a ridiculously long macro. Is there a way to condense this and just get it to repeat all the way down the worksheet?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Trying to increase cell value by 1

    Sub GS()
      Const sCol        As String = "A"
      Const iBeg        As Long = 4
      Const iEnd        As Long = 100
      Const iStp        As Long = 38
      Dim iRow          As Long
    
      Cells(iBeg, sCol).Value = 1
      For iRow = iBeg + iStp To iEnd Step iStp
        Cells(iRow, sCol).FormulaR1C1 = "=R[" & -iStp & "]C+1"
      Next iRow
    End Sub

+ 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] incremental increase in a cell based on value increase in another cell
    By umuni in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-18-2014, 05:23 AM
  2. Replies: 3
    Last Post: 12-16-2012, 12:49 PM
  3. Replies: 4
    Last Post: 12-12-2012, 03:03 PM
  4. Increase cell by 1, print as PDF and save PDF with that cell number as file name
    By eldred100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-13-2012, 09:39 AM
  5. Replies: 0
    Last Post: 01-10-2012, 03:48 PM
  6. Replies: 2
    Last Post: 07-12-2011, 11:08 AM

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