The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Excel 2003 Question

    Discussion in 'Windows OS and Software' started by Matt is Pro, Mar 16, 2009.

  1. Matt is Pro

    Matt is Pro I'm a PC, so?

    Reputations:
    347
    Messages:
    2,169
    Likes Received:
    0
    Trophy Points:
    55
    I have a spreadsheet with 2000+ rows and multiple columns.

    I need to make a line chart using only the time and temperature columns.

    However, I'd like to use only every 30th row, as like a "random" sampling of the data. Instead of manually going through 2000+ rows to select every 30th row, how can I do it all at once? Or at least, faster than doing it manually?
     
  2. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    not sure if this is what you are going for, but one way for a truly random sample might be create a new column (call it record number) and using the random function assign a number to that column.

    Now, copy the column, and paste special "values" back (to ensure it does not change again. Now sort on the record column number and just chart the first 30 rows
     
  3. DetlevCM

    DetlevCM Notebook Nobel Laureate

    Reputations:
    4,843
    Messages:
    8,389
    Likes Received:
    1
    Trophy Points:
    205
    I think you'll have to use a visual Basic macro.

    That is possibly the best way.

    I can't really help you with the details of Visual Basic though - while I may understand bits, its only beginner level easy stuff.
     
  4. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    The only way I can think of doing it with VB would be a macro that would hide 29 rows, skip one, then hide 29....etc....but I don't know if that really qualifies as "random"
     
  5. Matt is Pro

    Matt is Pro I'm a PC, so?

    Reputations:
    347
    Messages:
    2,169
    Likes Received:
    0
    Trophy Points:
    55
    I specifically want to select and make a line chart using the data from every 30th entry(row) in the time and temperature columns.
     
  6. DetlevCM

    DetlevCM Notebook Nobel Laureate

    Reputations:
    4,843
    Messages:
    8,389
    Likes Received:
    1
    Trophy Points:
    205
    Yepp, you need Visual Basic.
     
  7. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    agreed, but a simple macro ought to do it.

    Start on row 2, start macro recording, select 29 rows, choose HIDE, cursor down 2 rows, stop recording.

    Now just hold down your macro key combo until it runs through the entire spreadsheet.

    You could write a vba script with a FOR LOOP to do it all at once, but since you are only doing it once, no point in over complicating things