+ Reply to Thread
Results 1 to 2 of 2

Macro to Skip Rows between the current value and a selected value, and add a year

  1. #1
    Registered User
    Join Date
    02-26-2013
    Location
    virginia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to Skip Rows between the current value and a selected value, and add a year

    Hello,

    Here is my Code it's my best effort for a skipping rows program, but it's not what I'd like to do ultimately:

    Sub AddnumbersFinal()

    Dim i As Integer
    Dim j As Integer
    j = ActiveCell.Column
    i = ActiveCell.Row

    Do Until i = 2000
    .Cells(j, i).Value = YearVariable
    i = i + 7
    YearVariable = YearVariable + 1
    Cell(i, j).Value = YearVariable
    Loop
    End Sub


    Here is my ultimate goal. I want a graph relating the year to the average world value. The best solution would be this logic:

    1. Look at user defined cell value (year in this case; 1976) and add 1 to the current value.

    2. Move down rows until column A contains a cell that reads "Worldwide"

    3. Copy the new year in column O (1977 now), and copy the worldwide average value into column P

    Repeat

    This way, I could just select 1976, run the code, and I could have my x and y axes ready to plot.

    Thank you!
    Last edited by jll5ff; 03-19-2013 at 06:11 PM. Reason: Need to include file

  2. #2
    Registered User
    Join Date
    02-26-2013
    Location
    virginia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Macro to Skip Rows between the current value and a selected value, and add a year

    https://docs.google.com/spreadsheet/...EE&usp=sharing

    Here is a link to a googledoc. How do I attached a file?

+ 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