Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working on creating a macro that takes text data and import it into an
existing worksheet. To do this, I normally using the Import Data wizard. Since I do this several times a day, I am trying to create a macro that will allow me to select the text file and select a cell placement for the data once the text files is created. I have most of the code created, but cannot get it to pause at the file open dialog box or the cell range box. Are there specific codes I need to use to get this macro to do this? files into Excel from Word several times a day. With ActiveSheet.QueryTables.Add(Connection:="Text Files (*.txt), *.txt", _ Destination:=Range("A2")) .Name = "subcount" .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 = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierNone .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileOtherDelimiter = "|" .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Open the Menu Data,Refresh Data,filename,import | Excel Programming | |||
Macro to import data | Excel Programming | |||
Run a macro after data Import | Excel Programming | |||
import data with macro | Excel Discussion (Misc queries) | |||
Import Data macro | Excel Programming |