Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default For next index

The code below has a for next loop in it
how can I find out the "position" , ie is it the first time through the
loop, the last or the "n" th time through the loop.
I would be most gratefull if someone could enlighten me
Thanks in advance
David

no_values = True
Dim thecells As Range
For Each thecells In Range("quantity_range")
If thecells.Value < 0 Then
no_values = False
End If
Next



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default For next index

Hi

no_values = True
marker = 0
Dim thecells As Range
For Each thecells In Range("quantity_range")
marker = marker + 1
If thecells.Value < 0 Then
no_values = False
End If
If no_values = False then Exit for
Next
msgbox "Loop was exited on iteration " & marker

regards
Paul

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
INDEX and sum doctorbarry1947 Excel Discussion (Misc queries) 1 February 8th 10 01:19 PM
Chart axes color index vs font color index [email protected] Charts and Charting in Excel 4 December 7th 06 04:05 PM
How do I pull the col. index value as well as row index value Vikram Dhemare Excel Discussion (Misc queries) 1 March 29th 06 07:48 AM
index/index Bobby Excel Worksheet Functions 2 January 30th 06 05:53 PM
Index Row Lmbank Excel Worksheet Functions 0 December 20th 05 04:06 PM


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