+ Reply to Thread
Results 1 to 2 of 2

VBA code for data reduction of csv files

  1. #1
    Registered User
    Join Date
    05-04-2016
    Location
    uk
    MS-Off Ver
    10
    Posts
    1

    VBA code for data reduction of csv files

    Hi all,
    Apologies for what is probably a very basic question, but one I have been struggling with for days. Maybe someone can help?

    I have several thousand huge csv files that I need to reduce by data averaging. I want to open each one in excel, and then I want to average every 12 datapoints and put the output in the next column. I have no problems with any of the other parts of the macro, but I can't work out how to do the averaging - I have not had much success with offset, this is what I have tried:

    Dim strFormulas As Variant
    strFormulas = "=SUM(OFFSET(R7C1,(ROW()-ROW(R18C1))*12,0,12,1))"
    Range("C19").Formula = strFormulas
    Range("C19:C12000").FillDown

    Is there a better way, or can anyone help?

    Thanks so much

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: VBA code for data reduction of csv files

    Hi, welcome to the forum.
    Reading your description I don't get a clear picture of the data or the result you are trying to achieve.
    I suggest you make a sample spreadsheet with say 40 lines showing both the data as it arrives and the expected result.
    You can attach a spreadheet using the Go Advanced option for the reply.


    click on the * Add Reputation if this was useful or entertaining.

+ 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] Data reduction macro
    By pbd3mon in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-21-2016, 03:03 AM
  2. Data reduction macro
    By migrod1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2014, 04:21 PM
  3. profi code - need code reduction
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2011, 01:49 PM
  4. code for reduction
    By raviexcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2010, 04:59 AM
  5. Excel 2008 : Data Reduction
    By akuffel in forum Excel General
    Replies: 3
    Last Post: 06-01-2010, 08:56 AM
  6. data reduction
    By Leal72 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2008, 12:27 PM
  7. reduction Excel files size
    By neta in forum Excel General
    Replies: 2
    Last Post: 03-16-2007, 07:19 AM
  8. [SOLVED] Average data/reduction
    By MC in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-09-2006, 11:25 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