I currently have a large CSV file which data I want to import into an excel sheets. The way I was taught in a class to import was like this:
Dim tSouthStore1 As String
Dim tSouthStore2 As String
Dim tSouthStore3 As String
Dim tNorthStore1 As String
Dim tNorthStore2 As String
Dim sSouthGoats1 As Single
Dim sSouthGoats2 As Single
Dim sSouthGoats3 As Single
Dim sNorthGoats1 As Single
Dim sNorthGoats2 As Single
Dim sSouthChickens1 As Single
Dim sSouthChickens2 As Single
Dim sSouthChickens3 As Single
Dim sNorthChickens1 As Single
Dim sNorthChickens2 As Single
Open ThisWorkbook.Path & "\" & Trim(tSouthFile) For Input As #1
Open ThisWorkbook.Path & "\" & Trim(tNorthFile) For Input As #2
Input #1, tSouthStore1, sSouthGoats1, sSouthChickens1
Input #1, tSouthStore2, sSouthGoats2, sSouthChickens2
Input #1, tSouthStore3, sSouthGoats3, sSouthChickens3
Input #2, tNorthStore1, sNorthGoats1, sNorthChickens1
Input #2, tNorthStore2, sNorthGoats2, sNorthChickens2
Close #1
Close #2
Please tell me there is a better way to do this. The file I'm now working with is near 10,000 rows and 20-some columns. Also this is something I need to be doing a couple times a week, and the data sheets vary in size. How do I handle this?