Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2004, 12:07 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Importing text files into a worksheet

Hi

I am just learning VB and I cannot figure out how to import several fixed width txt files from a folder on my desktop into one excel worksheet.

I used the macro recorder to import one sheet at a time into my worksheet, but how can I automate this process? this needs to be done on a weekly basis and the number of txt files in my folder at any given week varies.

Your help is greatly appreciated.

Thanks.

 
Old March 19th, 2004, 12:53 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default

Hi

The ideal way to do this would be to use some VBScript or a VB app. You could schedule it on a machine or server. Use File System Object to read the line for every file in a given folder and write values to a spreadsheet.

Hope this points you in te right direction...

Regards
Marnus
 
Old March 19th, 2004, 04:28 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I appreciate your help. However, being a beginner, I am still lost. I will use your advice and try to read up on it. If anybody else has any other suggestions that would be helpful...

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing multiple text files to sql server db tammyk SQL Server DTS 1 April 25th, 2008 12:07 AM
Ftp text file from excel worksheet zone Excel VBA 0 July 31st, 2007 05:07 PM
importing files hotshot_21 VB.NET 2002/2003 Basics 0 January 5th, 2006 06:34 AM
Importing files in Access kathy stratton Access 6 February 2nd, 2005 07:49 AM
changing data type when importing Excel worksheet awwhite Access VBA 0 September 8th, 2004 09:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.