Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook
I have a need for sometype of loop control, I have a workbook where on
column E and G i'd like to copy data to another workbook. The data in column E will be placed into a second workbook in cell B1, the value copied is then multiplied by 25.4. In column G of the first workbook I then copy it's value to the second workbook and place into cell B3, it is then multiplied by 1000. The second workbook I can then perform some calculations, which I've figured out already by macro, the value in cell B7 resulting from the calculations is then placed into column K on the first workbook, but on the same row I took the origianal data from. The macro would then continue looping through until no more records are present in column E. Can anyone help Regards burl_rfc |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook
Could you simply add a user-defined function in the workbook that has the
data in columns E and G? In other words, insert a module into the workbook, then add a function like the following: Public Function MyCalculation(ValueE, ValueG) as double MyCalculation = 25.4 * ValueE + 1000. * ValueG 'Or whatever the math function is. End Function If you do not want to add the user-defined function in the workbook that has the data, then the function could be left in another workbook. After entering the formula in column K and filling down the worksheet, copy and pastespecial the values to eliminate the link to the workbook with the uwer-defined function. Maybe your function is too complicated for this or uses other lookup tables, etc. -- Regards, Bill |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
copy excel workbook to new workbook without data | Excel Worksheet Functions | |||
Import/Copy some data from one workbook to a similar workbook | Excel Programming | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
Copy cell data Workbook to Workbook | Excel Programming |