View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default 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.