Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
copy excel workbook to new workbook without data Omnitool Excel Worksheet Functions 3 March 14th 06 10:49 PM
Import/Copy some data from one workbook to a similar workbook [email protected] Excel Programming 11 March 7th 06 12:34 PM
Selecting data from 1 workbook to copy and paste to a 2nd workbook JackSpam Excel Programming 2 July 20th 05 02:33 AM
Copy cell data Workbook to Workbook Soli3d Excel Programming 2 February 1st 05 08:47 PM


All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"