Need help with loop to import data

S

silvest

I need some help with importing data on excel (.csv format).
This is briefly what i've done:

Dim Share(1 to 6) as string
Dim j as integer

House(1) = ABC
House(2) = DEF
House(3) = GHI
House(4) = JKL
House(5) = MNO
House(6) = PQR

For j = 1 To 6 Step 1

ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Excel\"House(j)".csv" _
, Destination:=Range("A1"))
...
..
..
 
S

silvest

Oops, a typo here...

In the 3rd line, it should read:

Dim *House*(1 to 6) as string

instead of Dim Share(1 to 6) as string

Thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top