Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help importing a text file


Hello everyone,

I am new to this forum as well as VBA. I am doing pretty well with m
macros but I am having two major problem that I can't find an answe
to. At work I have to create a lot of sales reports in excel, wit
imported data from our proprietary system. I import them as tex
files. I have been able to import a text file only if I program in th
name of the text file. The name of the text file is always different.
I want to be able to choose the name of the text file. Is thi
possible with VBA?

Thank you,
Danie

--
Djbloi
-----------------------------------------------------------------------
Djblois's Profile: http://www.excelforum.com/member.php...fo&userid=2596
View this thread: http://www.excelforum.com/showthread.php?threadid=39328

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Need help importing a text file

You'd want to do something like this:

Dim FName As Variant
FName = Application.GetOpenFilename("CSV File (*.csv), *.csv")
If FName < False Then
''open code goe here
End If


--
Jim
"Djblois" wrote in
message ...
|
| Hello everyone,
|
| I am new to this forum as well as VBA. I am doing pretty well with my
| macros but I am having two major problem that I can't find an answer
| to. At work I have to create a lot of sales reports in excel, with
| imported data from our proprietary system. I import them as text
| files. I have been able to import a text file only if I program in the
| name of the text file. The name of the text file is always different.
| I want to be able to choose the name of the text file. Is this
| possible with VBA?
|
| Thank you,
| Daniel
|
|
| --
| Djblois
| ------------------------------------------------------------------------
| Djblois's Profile:
http://www.excelforum.com/member.php...o&userid=25961
| View this thread: http://www.excelforum.com/showthread...hreadid=393286
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing a text file Helena MouriƱo Excel Discussion (Misc queries) 1 April 2nd 09 07:20 PM
Importing CSV file (saved as Text) into XL as Text -- over 60 colu sbp Excel Discussion (Misc queries) 1 October 14th 06 11:50 PM
Importing text file, only option to edit existing file smokey99 Excel Discussion (Misc queries) 8 April 26th 06 09:08 PM
importing text file, removing data and outputting new text file Pal Excel Programming 8 February 27th 04 08:32 PM
Importing Text File Daniel Brow Excel Programming 1 February 9th 04 01:20 AM


All times are GMT +1. The time now is 06:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"