Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro which automatically imports the contents of a .csv file. The
data which is imported into Coulmn A is a date but it is not in the format that we want. When it is imported, it looks like this... 20081223155307 We want it to look like this... 12/23/08 We currently have the column format set as Numeric without decimal places. Can we set the column to a Date format and then have the macro automatically truncate and convert the imported data to the format we want? Here is my macro which does the import... With ActiveSheet.QueryTables.Add(Connection:="TEXT;c:\U PS_CSV_EXPORT.csv",Destination:=rDest) .Name = "UPS_CSV_EXPORT" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = False .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 437 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = True .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With -- Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
scroll automatically as data is imported into a spreadsheet | Excel Discussion (Misc queries) | |||
automatically updating imported statistics | New Users to Excel | |||
Automatically modifying imported reports | Excel Discussion (Misc queries) | |||
How do I format a column to automatically make it a negative numbe | Excel Worksheet Functions | |||
How to automatically adapt column width with XML format? | Excel Programming |