Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet with many rows and columns in it. I
would like to send values from 4 cell to a "calculator" on another work sheet. I then want to return the calculated value back to the original worksheet. Then go down to the next row and repeat the process. I can do it with a macro but I have 1300 rows and it will get very tedious. Is there a FUNCTION that will send the value? Thank you Howard |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used the four cells in columns A:D and sent them to a second worksheet
(somewhere!). Then returned a single cell into column E of the same row: Option Explicit Sub testme() Dim InputWks As Worksheet Dim CalcWks As Worksheet Dim myRng As Range Dim myCell As Range Set InputWks = Worksheets("sheet1") Set CalcWks = Worksheets("sheet2") With InputWks 'headers in row 1 Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp)) End With With CalcWks For Each myCell In myRng.Cells .Range("a1").Value = myCell.Value .Range("b3").Value = myCell.Offset(0, 1).Value .Range("c9").Value = myCell.Offset(0, 2).Value .Range("e99").Value = myCell.Offset(0, 3).Value Application.Calculate myCell.Offset(0, 4).Value = .Range("z1").Value Next myCell End With End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Howard wrote: I have a spreadsheet with many rows and columns in it. I would like to send values from 4 cell to a "calculator" on another work sheet. I then want to return the calculated value back to the original worksheet. Then go down to the next row and repeat the process. I can do it with a macro but I have 1300 rows and it will get very tedious. Is there a FUNCTION that will send the value? Thank you Howard -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying to move photo behind text. "Send back" doesn't work. | Excel Worksheet Functions | |||
Excel 2003 giving annoying "Send/Don't Send" error when closing | Excel Discussion (Misc queries) | |||
How do I write an excel formula with a text answer ("yes" or "no") | Excel Discussion (Misc queries) | |||
Signature missing when "send to" "mail recipient" | Excel Discussion (Misc queries) | |||
Changing "returned" values from "0" to "blank" | Excel Worksheet Functions |