View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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