+ Reply to Thread
Results 1 to 2 of 2

Filtering Time Stamp Data - every 100th data group

Hybrid View

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Filtering Time Stamp Data - every 100th data group

    Greetings!

    This is my first time posting to this forum. I'm a longtime user of Excel, though not advanced; I'd say intermediate.

    I have to sort and plot roughly a year's worth of data (some of it collected as frequently as every 10 seconds) and it's more data than is necessary to complete the task. Is there a straightforward way to pluck every, say, 100th data point and copy / paste to a new sheet, or delete the remainder?

    I assume this falls under programming / macros, but if there is a simple solution, I'm all eyes!

    thanks,

    P

  2. #2
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Filtering Time Stamp Data - every 100th data group

    Try this
    Sub Copy_Every_100()
        Dim lrow As Long
        Dim srow As Long 
        Dim i As Long 
    
        With Application
            .ScreenUpdating = False
            .Calculation = xlCalculationManual
        End With
        
        srow = 2    'starting row set to second row
        lrow = Range("A50000").End(xlUp).Offset(1, 0).Row 'change if last row is greater than 50k
        i = 2 'paste row start
        
        Do Until srow >= lrow
            Cells(srow, 1).EntireRow.Copy
            Sheets("Sheet2").Cells(i, 1).PasteSpecial 'Change paste sheet name 
        srow = srow + 100
        i = i + 1
        Loop
        
        With Application
            .ScreenUpdating = True
            .Calculation = xlCalculationAutomatic
        End With
        
    End Sub

+ 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