LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Variable error on second use???

Hi I am checking to see if a "score" crosses above 0 and if so moving its
value to a second sheet. I get an error on Sheets("watch
list").Range(nex****ch).Offset(1, 1) = Sheets("scores").Range("b" & i.Row)...
which I can't figure since the line right before this one works....

Sub scorecross()

For Each i In Sheets("Scores").Range("b2:b501")
If Range("c" & i.Row) < 0 And Range("b" & i.Row) 0 Then
nx****ch = Sheets("watch list").Range("a4000").End(xlUp).Address
Sheets("watch list").Range(nx****ch).Offset(1, 0) =
Sheets("scores").Range("a" & i.Row)
Sheets("watch list").Range(nex****ch).Offset(1, 1) =
Sheets("scores").Range("b" & i.Row)
Sheets("watch list").Range(nex****ch).Offset(1, 2) = "Cross UP"
Sheets("watch list").Range(nex****ch).Offset(1, 3) =
Sheets("Scores").Range("b1")
End If
If Range("c" & i.Row) 0 And Range("b" & i.Row) < 0 Then
nx****ch = Sheets("watch list").Range("a4000").End(xlUp).Address
Sheets("watch list").Range(nx****ch).Offset(1, 0) =
Sheets("scores").Range("a" & i.Row)
Sheets("watch list").Range(nex****ch).Offset(1, 1) =
Sheets("scores").Range("b" & i.Row)
Sheets("watch list").Range(nex****ch).Offset(1, 2) = "Cross DOWN"
Sheets("watch list").Range(nex****ch).Offset(1, 3) =
Sheets("Scores").Range("b1")
End If
Next
End Sub

Thanks for help!
 
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
Runtime Error 91 Object variable or With block variable not set. Tim Excel Programming 9 June 5th 08 10:03 PM
Need help with Error 'object variable or with block variable not set' Francois via OfficeKB.com Excel Programming 5 April 30th 07 03:05 PM
Getting inconsistent Error 91-Object variable or With block variable not set mfq Excel Programming 0 December 14th 05 06:08 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"