LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default User Select File on Import External Data

Using Excel 2003. I am importing data into a ws and applying filters to it
to use elsewhere. How can I have the query run so the user can select the
file to be imported? The file name is always the same, it is the directory &
sub directory that will be different each day. What I have so far is:

Sub ImportData()
'
Sheets("Import").Select

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;F:\2010\January\Jan31\COOP\dscdc004.rtf" ,
Destination:=Range("A1")) <---------this line is the problem - need to
select file
.Name = "dscdc004"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 172
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(2, 9, 1, 9, 1, 9)
.TextFileFixedColumnWidths = Array(19, 74, 4, 47, 13)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Columns("A:C").Select
Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:="WD"
Selection.AutoFilter Field:=3, Criteria1:="399.99", Operator:=xlAnd, _
Criteria2:="<485.00"
End Sub

Any help is apprectiated
--
Linda
 
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
CSV Import - user to select file joecrabtree Excel Programming 1 December 13th 06 02:29 PM
import external data from changing file name nathan Excel Worksheet Functions 2 April 6th 05 04:39 PM
External File Data Import Adam Thickett Excel Programming 3 September 3rd 03 04:03 PM
External File Data Import (F.A.O. Bernie) Adam Thickett Excel Programming 0 September 3rd 03 10:43 AM
Get External Data, Import Text File, File name problem Scott Riddle Excel Programming 1 July 11th 03 05:40 PM


All times are GMT +1. The time now is 09:52 AM.

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"