Excel data-source from text files -
i have multiple reports created linux , saved tabbed text files. when open updated text report in excel, find myself doing same steps on , on again (create table, set filters, pivot, create chart, etc).
is there way create spreadsheet text file, configure liking, , in future, able refresh data set based on new text file provide? text file format stays same , tweaked accommodate excel. ideally, prefer without vba, that's minor consideration.
without vba think it's difficult. can use that:
dim nlast integer workbooks.opentext filename:="e:\0\aa.txt", origin:=xlmsdos, startrow:=1 _ , datatype:=xldelimited, textqualifier:=xldoublequote, _ consecutivedelimiter:=false, tab:=true, semicolon:=false, comma:=false _ , space:=false, other:=false, fieldinfo:=array(array(1, 1), array(2, 1)), _ trailingminusnumbers:=true nlast = cells.find("*", searchorder:=xlbyrows, searchdirection:=xlprevious).row range("a1:b" & nlast).select selection.copy windows("book1.xlsm").activate range("b7").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false
open txt file, copy , paste value on model file (with pivot, chart ...)
data in sheet start b7.
Comments
Post a Comment