The home of intelligent horse racing discussion
The home of intelligent horse racing discussion

Compiling your own standard times

Home Forums Archive Topics Trends, Research And Notebooks Compiling your own standard times

Viewing 2 posts - 52 through 53 (of 53 total)
  • Author
    Posts
  • #325416
    Vladellis
    Participant
    • Total Posts 1

    1st time poster, so "Hello!".

    Fascinating thread. Not here to provide my opinion on the merits or otherwise of speed ratings, but I can help with Mr Wilsons task. Very simple excel macro to loop through files in a folder and process each as required (in this case gather data).

    Suggest you open a new workbook, copy the macro in to a new module then change variables as required, e.g.
    fPath – change to your directory where your data stored
    fName – change to ".xls" or whatever format they are saved in.
    Windows("GatheringDB.xlsm").Activate – change to whatever you call your master file.

    I have used it, it is stable if simple. Code follows.

    Sub ConvertAllFiles()

    Dim fPath As String, fName As String, sName As String
    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    fPath = "D:BettingHorseRacingHistoric DataUKHorseRacingData"
    fName = Dir(fPath & "*.csv")

    Do While Len(fName) > 0
    Workbooks.Open fPath & fName
    Range("A2").Select
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
    Selection.Copy
    Windows("GatheringDB.xlsm").Activate
    Sheets("Sheet1").Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.PasteSpecial (xlPasteValues)
    Application.CutCopyMode = False
    Selection.End(xlDown).Select
    ‘ Windows(fPath & fName).Activate
    ‘ ActiveWorkbook.Close False
    fName = Dir
    Loop

    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub

    #325422
    Avatar photoTheBluesBrother
    Participant
    • Total Posts 1085

    The is a bespoke program called Merge Excel Files.

    [code:25jatezt]http://www.excel-tool.com/mergefiles.html[/code:25jatezt]

    I happen to have a copy on my blog 8)

Viewing 2 posts - 52 through 53 (of 53 total)
  • You must be logged in to reply to this topic.