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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
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
Replace worksheet without affecting the referencing formula Jay Excel Discussion (Misc queries) 1 May 7th 09 03:11 AM
Same formula referencing same cells returns incorrect results, randomly, when pasted into new worksheet [email protected] Excel Worksheet Functions 1 March 9th 06 07:55 PM
VB formula referencing other worksheet [email protected] Excel Programming 2 January 19th 06 04:08 PM
Formula Referencing Worksheet Name by Variable Soo Cheon Jheong[_2_] Excel Programming 0 August 5th 04 04:41 AM
Formula Referencing Worksheet Name by Variable Mister T Excel Programming 0 August 5th 04 12:13 AM


All times are GMT +1. The time now is 05:08 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"