Hello Guys,

I'll start off with saying I have rather limited knowledge with Excel Macro's and VB programming. I am also using Excel 2010.

What I intended to do is develop a macro that that will load a CSV file into my Excel Spreadsheet below the existing data I already have. I will be uploading a CSV file into it every month. I developed a macro that adds a CSV file into the spreadsheet, However, this will only properly work once. If I run the macro again, instead of putting the contents of the CSV file below the existing data (which is all in columns A,B and C), it shifts all the data over.

The problem with this is I need all the data to be in columns A, B, C because I have created formulas to automatically generate a graph.

So basically my question is, How do I import a CSV file to be added below my existing data in columns A, B and C?


Here is a picture of my Excel spreadsheet.Excel Help.jpg. All data should be in columns A, B and C. I have two different macro buttons. When I click the "step 2" macro button it will load the CSV file into the spreadsheet, and the formulas will generate data for the graph.

Here is a picture of the problem I experience when I run the Macro more than once. Excel Help 2.jpg. In this picture you can see how all the data gets shifted, instead of putting the new data below the existing data.

Here is the macro that I already have
Sub Importing_CSV_File_from_PSS()
'
' Importing_CSV_File_from_PSS Macro
'

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;C:\Users\brandon.fox\Desktop\Diabetes_test.txt", Destination:=Range( _
        "$A$59"))
        .Name = "Diabetes_test"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 850
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = False
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = True
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1, 1, 9, 9, 2, 9, 9, 9, 1)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    ActiveWindow.SmallScroll Down:=0
End Sub
I will greatly appreciate any help. I apologize if this is a rather simple task as well. Thanks guys