Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When using the For i = 1 to 10
€˜Your code Next i Can I define i = 1 to 10 (excluding certain values)? I want the code to be executed only for i= 1,4,5,6,8,10 Thanks -- caroline |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for i = 1 to 10
Select Case i case 1, 4, 5, 6, 8, 10 End Select Next -- Regards, Tom Ogilvy "caroline" wrote: When using the For i = 1 to 10 €˜Your code Next i Can I define i = 1 to 10 (excluding certain values)? I want the code to be executed only for i= 1,4,5,6,8,10 Thanks -- caroline |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub caroline()
s = Array(1, 4, 5, 6, 8, 10) For i = LBound(s) To UBound(s) MsgBox (s(i)) Next End Sub -- Gary''s Student - gsnu200724 "caroline" wrote: When using the For i = 1 to 10 €˜Your code Next i Can I define i = 1 to 10 (excluding certain values)? I want the code to be executed only for i= 1,4,5,6,8,10 Thanks -- caroline |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Dim vArr As Variant Dim i As Long Dim j As Long vArr = Array(1,4,5,6,8,10) For j = LBound(vArr) to UBound(varr) i = vArr(j) 'Your code Next j In article , caroline wrote: When using the For i = 1 to 10 €˜Your code Next i Can I define i = 1 to 10 (excluding certain values)? I want the code to be executed only for i= 1,4,5,6,8,10 Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
matching consecutive values | Excel Discussion (Misc queries) | |||
Count Consecutive Values | Excel Discussion (Misc queries) | |||
Exclude #N/A values and Return Numeric values to consecutive cells in Single Row | Excel Worksheet Functions | |||
Return Consecutive Values - Pairs | Excel Worksheet Functions | |||
Return Consecutive Values | Excel Worksheet Functions |