Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to put the calculation in a separate tab and results in other one.
Is it possible to use relative reference for addressing between two tabs? To explain completely, I want to get A1 value from Sheet1 as an input value, take it to Sheet2, perform some calculations there and return the final result of calculation as a single value to B1 in Sheet1 . |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not sure what you mean by performing some calculation on Sheet2. If you
are talking VB code (which is the main item discussed here in this excel.programming newsgroup), why not perform the calculation in VB? And if you are talking worksheet formulas, whatever calculation you are performing on Sheet2 could be done in Sheet1 just as easily. Perhaps if you provide more detail about your layout and what you are trying to do with it, maybe things would be clearer. -- Rick (MVP - Excel) "Khoshravan" wrote in message ... I want to put the calculation in a separate tab and results in other one. Is it possible to use relative reference for addressing between two tabs? To explain completely, I want to get A1 value from Sheet1 as an input value, take it to Sheet2, perform some calculations there and return the final result of calculation as a single value to B1 in Sheet1 . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You'll have to change this to use the right cells on the calculation sheet:
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 'populate the CalcWks with values from the input sheet .Range("a1").Value = myCell.Value .Range("x99").value = mycell.offset(0,1).value .range("iv323").value = mycell.offset(0,2).value 'do the calculation Application.Calculate 'take some values back from the calcwks to the input sheet myCell.Offset(0, 3).Value = .Range("b1").Value myCell.Offset(0, 4).Value = .Range("c1").Value myCell.Offset(0, 5).Value = .Range("d1").Value Next myCell End With End Sub If you're new to macros: Debra Dalgleish has some notes how to implement macros he http://www.contextures.com/xlvba01.html David McRitchie has an intro to macros: http://www.mvps.org/dmcritchie/excel/getstarted.htm Ron de Bruin's intro to macros: http://www.rondebruin.nl/code.htm (General, Regular and Standard modules all describe the same thing.) Khoshravan wrote: I want to put the calculation in a separate tab and results in other one. Is it possible to use relative reference for addressing between two tabs? To explain completely, I want to get A1 value from Sheet1 as an input value, take it to Sheet2, perform some calculations there and return the final result of calculation as a single value to B1 in Sheet1 . -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In am talking about recording a Macro. In this MAcro I want to get input data
from one sheet and perform calculation in another sheet. Also I want to know if relative reference works in this situation (between two sheets) or not. "Rick Rothstein" wrote: I'm not sure what you mean by performing some calculation on Sheet2. If you are talking VB code (which is the main item discussed here in this excel.programming newsgroup), why not perform the calculation in VB? And if you are talking worksheet formulas, whatever calculation you are performing on Sheet2 could be done in Sheet1 just as easily. Perhaps if you provide more detail about your layout and what you are trying to do with it, maybe things would be clearer. -- Rick (MVP - Excel) "Khoshravan" wrote in message ... I want to put the calculation in a separate tab and results in other one. Is it possible to use relative reference for addressing between two tabs? To explain completely, I want to get A1 value from Sheet1 as an input value, take it to Sheet2, perform some calculations there and return the final result of calculation as a single value to B1 in Sheet1 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Relative Reference help | Excel Discussion (Misc queries) | |||
Relative reference for named tabs? | Excel Worksheet Functions | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
Relative Reference | Excel Programming | |||
Relative Reference | Excel Discussion (Misc queries) |