Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro which import alfa*.txt file, how to ?

Hi,
I need an help on how to make a macro getting any of the alfa*.txt
from a directory (ex. alfa1.txt alfa2.txt etc etc)
I used :
With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\a lfa*.txt", _
Destination:=Range("C3"))

....but this didn't work. Is there a way to insert a jolly character
instaed of * (star) ?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default macro which import alfa*.txt file, how to ?

sStr = dir("c:\alpha*.txt")
if sStr < "" then
With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\" & sStr, _
Destination:=Range("C3"))

. . .
End With
End if

--
Regards,
Tom Ogilvy

"ss_era" wrote in message
om...
Hi,
I need an help on how to make a macro getting any of the alfa*.txt
from a directory (ex. alfa1.txt alfa2.txt etc etc)
I used :
With ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\a lfa*.txt", _
Destination:=Range("C3"))

...but this didn't work. Is there a way to insert a jolly character
instaed of * (star) ?

Thanks



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
Can I import text file of cash flow to excel file then use formula Bumpa Excel Discussion (Misc queries) 2 May 28th 10 04:22 PM
macro-import another xls file puiuluipui Excel Discussion (Misc queries) 9 April 1st 10 06:48 PM
Skipping Import Text File dialog in a Macro Leon Excel Discussion (Misc queries) 5 January 21st 08 09:12 PM
add nummeric and alfa to one alfanumeric number Henk Excel Discussion (Misc queries) 2 October 2nd 07 09:42 PM
Import text file without specifying a path macro won't work Bruiser Excel Programming 3 January 20th 04 11:47 PM


All times are GMT +1. The time now is 06:36 AM.

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

About Us

"It's about Microsoft Excel"