ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with loop to import data (https://www.excelbanter.com/excel-programming/311180-need-help-loop-import-data.html)

silvest

Need help with loop to import data
 

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"))
...
..
..

silvest[_3_]

Need help with loop to import data
 

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

--
silves
-----------------------------------------------------------------------
silvest's Profile: http://www.excelforum.com/member.php...fo&userid=1466
View this thread: http://www.excelforum.com/showthread.php?threadid=26283



All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com