Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing another worksheet in a formula
Afternoon,
As titled really, I'm sure it'll be easy for you clever lot. The other sheet is called Refnumbers. Here's the code so far: Dim i As Integer Dim j As Integer i = 6 j = 1 Do While i < x Cells(i, j).Select Select Case Cells(i, j).Value Case 100, 101, 102, 103, 104, 105, 106, 107, 110, 141, 160, 171, 191 Cells(i, j + 2).Select Dim answer As String **answer = Cells(i, j + 1).Value * Refnumbers!Cells(5, 2).Value** ActiveCell.Formula = answer i = i + 1 etc The debugger sticks on the line with ** at each end. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing another worksheet in a formula
answer = Cells(i, j + 1).Value * Worksheets("Refnumbers").Cells(5, 2).Value
-- Charles Chickering "A good example is twice the value of good advice." "Josie" wrote: Afternoon, As titled really, I'm sure it'll be easy for you clever lot. The other sheet is called Refnumbers. Here's the code so far: Dim i As Integer Dim j As Integer i = 6 j = 1 Do While i < x Cells(i, j).Select Select Case Cells(i, j).Value Case 100, 101, 102, 103, 104, 105, 106, 107, 110, 141, 160, 171, 191 Cells(i, j + 2).Select Dim answer As String **answer = Cells(i, j + 1).Value * Refnumbers!Cells(5, 2).Value** ActiveCell.Formula = answer i = i + 1 etc The debugger sticks on the line with ** at each end. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
referencing another worksheet in a formula
You star. This has been driving me up the wall.
"Charles Chickering" wrote: answer = Cells(i, j + 1).Value * Worksheets("Refnumbers").Cells(5, 2).Value -- Charles Chickering "A good example is twice the value of good advice." "Josie" wrote: Afternoon, As titled really, I'm sure it'll be easy for you clever lot. The other sheet is called Refnumbers. Here's the code so far: Dim i As Integer Dim j As Integer i = 6 j = 1 Do While i < x Cells(i, j).Select Select Case Cells(i, j).Value Case 100, 101, 102, 103, 104, 105, 106, 107, 110, 141, 160, 171, 191 Cells(i, j + 2).Select Dim answer As String **answer = Cells(i, j + 1).Value * Refnumbers!Cells(5, 2).Value** ActiveCell.Formula = answer i = i + 1 etc The debugger sticks on the line with ** at each end. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replace worksheet without affecting the referencing formula | Excel Discussion (Misc queries) | |||
Same formula referencing same cells returns incorrect results, randomly, when pasted into new worksheet | Excel Worksheet Functions | |||
VB formula referencing other worksheet | Excel Programming | |||
Formula Referencing Worksheet Name by Variable | Excel Programming | |||
Formula Referencing Worksheet Name by Variable | Excel Programming |