I need a macro to import a text file into a worksheet with formulas. I manually import a text file into a worksheet and then copy formulas. I know there has to be a simpler way. Thanks
Surprising as it may seem, a file with .csv extension can have formulae. (At least in Excel 2K)
For example, the following file has the name testdata.csv:
IFRs: Simultaneous posts are a problem on this site. I just tried your suggestion with a .txt file that has formulae and it works! Very good -- thanks for the post.
bryman: Please ignore the last sentence of my post.
Data>get external data>new database query>select text files from the list in the left tab...follow the wizard, or select the use MS query option,...carefully select options you want on each window,...such as "read only" check boxes and what not...
then return data to ms excel.
when the data is returned, you can right click in the data area and set properties such as refresh on open, autofill formulas, and so on.
Then you need to only enter formulas in excel 1 time
and they will expand or contract as the source data(your text file) grows in size or shrinks.
You now only need to open the spreadsheet. to view the current data in that text file.
now when ever the text file is updated the workbook will reflect the changes.(if you refresh...auto or manually)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.