Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was wondering if the was a way to skip numbers in a counting
sequence. For example: For i = 1 to 10 next i Is there a way to skip over 5, 6, 7 so the count could be 1, 2, 3, 4, 8, 9, 10? Thanks in advance. Sandy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sandy
Try this: For i = 1 to 10 If i < 5 Or i < 6 Or i < 7 Then yourprocedure End if Next Regards Steve |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sandy
Probably better is: If i < 5 Or i 7 Then... Regards Steve |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just check?
For i = 1 to 10 select case i case 5,6,7 'do nothing case else 'do what you want end select next i Sandy wrote: I was wondering if the was a way to skip numbers in a counting sequence. For example: For i = 1 to 10 next i Is there a way to skip over 5, 6, 7 so the count could be 1, 2, 3, 4, 8, 9, 10? Thanks in advance. Sandy -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many ways, such as
For i = 1 to 10 If i 4 And i < 8 Then ... your bits End If next i or For i = 1 to 10 ... your bits If i = 4 Then i = 7 Next i and many others I am sure -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Sandy" wrote in message ups.com... I was wondering if the was a way to skip numbers in a counting sequence. For example: For i = 1 to 10 next i Is there a way to skip over 5, 6, 7 so the count could be 1, 2, 3, 4, 8, 9, 10? Thanks in advance. Sandy |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for i = 1 to 10
if i < 5 or i 7 then end if Next -- Regards, Tom Ogilvy "Sandy" wrote: I was wondering if the was a way to skip numbers in a counting sequence. For example: For i = 1 to 10 next i Is there a way to skip over 5, 6, 7 so the count could be 1, 2, 3, 4, 8, 9, 10? Thanks in advance. Sandy |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Since i is a variable couldn't you...
For i = 1 to 10 if i=4 then i=7 Next i Jesse |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() well..a simple code, so many answers..Jesse Wins :o) Cheers..... -- vikas.bhandari ------------------------------------------------------------------------ vikas.bhandari's Profile: http://www.excelforum.com/member.php...o&userid=33276 View this thread: http://www.excelforum.com/showthread...hreadid=530938 |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Most consider it bad form to change the index variable within a loop.
-- Regards, Tom Ogilvy "vikas.bhandari" wrote: well..a simple code, so many answers..Jesse Wins :o) Cheers..... -- vikas.bhandari ------------------------------------------------------------------------ vikas.bhandari's Profile: http://www.excelforum.com/member.php...o&userid=33276 View this thread: http://www.excelforum.com/showthread...hreadid=530938 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|