Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Path = "\blahblahblah"
- Prefix = "24hr_Export_"
- Suffix = "_00_00_14"
- FName = Prefix & DayTime & Suffix & ".csv"
- ImportCsvFile Path & FName, ActiveSheet.Cells(1, 1)
- Sub ImportCsvFile(FileName As Variant, Position As Range)
- With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & FileName, Destination:=Position)
- .Name = Replace(FileName, ".csv", "")
- .FieldNames = True
- .RowNumbers = False
- .FillAdjacentFormulas = False
- .RefreshOnFileOpen = False
- .BackgroundQuery = True
- .RefreshStyle = xlInsertDeleteCells
- .SavePassword = False
- .SaveData = True
- .AdjustColumnWidth = True
- .TextFilePromptOnRefresh = False
- .TextFilePlatform = xlMacintosh
- .TextFileStartRow = 1
- .TextFileParseType = xlDelimited
- .TextFileTextQualifier = xlTextQualifierDoubleQuote
- .TextFileConsecutiveDelimiter = False
- .TextFileTabDelimiter = True
- .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)
- .Refresh BackgroundQuery:=False
- End With
- End Sub
- FName = Dir("c:24hr_Export_2013_11_15_*.csv")
- FName = Dir("c:24hr_Export_2013_11_15_??_??_??.csv")
- FName1 = Dir("c:BCH" & "??-??" & ".xlsx")
- Range("A5").Select
- ActiveCell.FormulaR1C1 = "OK"
- FName2 = Dir("c:Portafolio" & "??-??" & ".xlsx")
- Range("A3").Select
- ActiveCell.FormulaR1C1 = "OK"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement