F
Frank
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 are:
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
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 are:
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