Compiling CSVs using excel?
•
19 Jun 2012, 16:35
•
Journals
Hey,
I have multiple CSVs generated via Google Analytics. They data they produce is as follows:
Country / Country ID / Impressions
The idea of using them as CSVs is so that I can compile all the results to get a total across all the websites. But errr how? How do I input X csvs and output Y totals.
I have multiple CSVs generated via Google Analytics. They data they produce is as follows:
Country / Country ID / Impressions
The idea of using them as CSVs is so that I can compile all the results to get a total across all the websites. But errr how? How do I input X csvs and output Y totals.
If yes :
-Excel macro : http://www.excel-downloads.com/forum/attachments/forum-excel/48974d1162487712-concatener-plusieurs-xls-recap.xls
-code : Sub Conbinesheets()
Dim wb As Workbook
Dim wsCible As Worksheet
Dim ws As Worksheet
Dim cpy As Variant
Dim fic As String
Dim adrCible As String
Dim derLigneCible As Integer
Dim nbLigneSource As Integer
Dim no As String * 2
Dim iFic As Integer
Dim i As Integer
Application.ScreenUpdating = False
Set wsCible = ThisWorkbook.Sheets(1)
derLigneCible = 1
For iFic = 1 To 10
no = Format(iFic, "0#")
fic = "C:formsForm" & no & ".csv"
Set wb = Workbooks.Open(fic)
Set ws = wb.Sheets(1)
nbLigneSource = ws.Range("A65535").End(xlUp).Row
For i = 1 To nbLigneSource
adrCible = "A" & derLigneCible
cpy = ws.Rows(i).Value
wsCible.Range(adrCible).EntireRow.Value = cpy
derLigneCible = derLigneCible + 1
Next i
Application.DisplayAlerts = False
wb.Close
Application.DisplayAlerts = True
Next iFic
Application.ScreenUpdating = True
End Sub
Actually, I think your columns need to have the same titles in all the CSVs (xls, or w/e) in order to merge your DBs.
e: but will be big improvement none the less!