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: 24
Default For Each not workig correctly

Hi,
In the following block of code, theoretically, each cell in a range
gets compared to one above it. If it matches, nothing happens. If it is
different, the macro CreatePSFrontLabel runs. What actually happens,
though, is the macro runs for the first six cells in the range (no
matter how it compares to the cell above it) and then stops.
Thanks in advance,
Joe


Sub MOO()

Dim rng As Range
With Sheets("Scroller Info")
Set rng = .Range(.Range("E2"), .Range("E2").End(xlDown))
End With

For Each cell In rng
If cell.Value < cell.Offset(-1).Value Then
CreatePSFrontLabel
End If
Next

 
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
not printing correctly QB Excel Discussion (Misc queries) 0 November 3rd 09 09:49 PM
Not Pasting Correctly Larry G. Excel Discussion (Misc queries) 3 July 6th 05 08:33 PM
How do I use checkboxes correctly? erikeve Excel Discussion (Misc queries) 1 January 15th 05 06:31 PM
How to write this correctly? Michael[_27_] Excel Programming 5 September 20th 04 11:51 PM
I hope I ask this correctly Mark Excel Programming 3 March 5th 04 03:23 PM


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