Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
Thanks in advance for reading. I have two input files: MainInput.xls and ParCombos.txt. ParCombos.txt is a tab delimited text file that has 4 columns. Each row in this document contains a combination of 4 parameters. MainInput.xls is an Excel file that has 2 worksheets. On the first sheet there are many columns with data and formulas. All of the values being calculated on this sheet, depend on 4 cells: A1, A2, A3, A4. The second sheet has many columns with formulas. These formulas depend on the values that were calculated on Sheet 1. I desperately need to write a macro to do the steps below, but I don't know where to start. The steps a 1. Open ParCombos.txt, and copy the values in the 1st row. 2. paste the value from the 1st column of ParCombos.txt into A1 of Sheet 1 of MainInput.xls paste the value from the 2nd column of ParCombos.txt into A2 of Sheet 1 of MainInput.xls paste the value from the 3rd column of ParCombos.txt into A3 of Sheet 1 of MainInput.xls paste the value from the 4th column of ParCombos.txt into A4 of Sheet 1 of MainInput.xls 3. Wait for the values in both sheets 1 and 2 in Maininput.xls to be recalculated [This MainInput.txt file is a 40Mb file]. 4. Go to Sheet 2 of Maininput.xls and Save it [only Sheet 2] as Maininput1.txt [in some/any directory]. Save it as a Tab delimited text file. 5. Repeat steps 1-5 for the values of the 2nd row of ParCombos.txt. Keep repeating steps 1-5 until we run out of rows in ParCombos.txt Thus, if ParCombos.txt has X rows, then the output of this macro would be X tab delimited files named Maininput1.txt, MainInput2.txt, ..., MainInputx.txt Any help would be appreciated. Many Thanks Frank |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Macro to Open File, Delete Contents, Save New File | Excel Discussion (Misc queries) | |||
Can you save 1 sheet from a large file into another file? | Excel Worksheet Functions | |||
how do I get a macro to save a sheet and set the file name? | Excel Discussion (Misc queries) | |||
copy the same raws of all sheets from about a 100 file to a new sheet of a book and save the file | Setting up and Configuration of Excel | |||
Automate open file, update links, run macro, close and save file | Excel Programming |