Batch importing CVS files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Guest
Hi,
I am looking to import lots of cvs files with different names, eg
0503200201.htd,
0503200202.htd,
0503200203.htd
and so no. After importing I want to delete this files. Is the possible in Excel OR Access.

Thanks

Bscull.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
In the VBE editor look up "Kill"

eg. Kill "c:CSVFiles*.csv"

will delete ALL files with csv extensions.
Pay to put in an error routine + confimation
JIC !!

Sub kills()
Dim OKToDelete As Integer
Dim sDir As String

sDir = "C:CSVFiles"

On Error GoTo FileErr
OKToDelete = MsgBox("Delete files in " & sDir, vbYesNo)
If OKToDelete = vbNo Then End
Kill sDir & "*.csv"
MsgBox "Done!"

FileErr:
MsgBox Err.Number & ":=" & Err.Description

End Sub


or something similar


HTH

Ivan
 
Upvote 0
Great, Thanks.

But how can I batch import lots of files with different names? There is only some parts of the file structure that I need to use.

Thanks

Bscull
 
Upvote 0
On 2002-03-06 03:05, Anonymous wrote:
Great, Thanks.

But how can I batch import lots of files with different names? There is only some parts of the file structure that I need to use.

Thanks

Bscull

Have a look at:

http://ca.geocities.com/b_davidso/Web_Page_Files/excel_vba.html

and look for the question "I have an Excel Template file (report.xlt) and text files (1.txt, 2.txt, 3.txt etc - 45 of this text files) in the same directory". The code for this could easily be modified to do what you're looking for. If you need any help just let me know.

Regards,
 
Upvote 0
THANKS Everyonbe.

Barrie if i need a hand I will give you a call

Thanks again.

Bscull
 
Upvote 0
THANKS Everyone.

Barrie if i need a hand I will give you a call

Thanks again.

Bscull
 
Upvote 0

Forum statistics

Threads
1,223,396
Messages
6,171,866
Members
452,427
Latest member
samk379

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top