View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default Non-Sequential Count

a couple of ways
Sub test()
Dim i As Long
For i = 1 To 8
If i < 3 Or i 4 Then
MsgBox i
End If
Next
End Sub
Sub test2()
Dim i As Long
Dim arr As Variant
arr = Array(1, 2, 5, 6, 7, 8)
For i = LBound(arr) To UBound(arr)
MsgBox arr(i)
Next
End Sub

--


Gary


"Brian" wrote in message
...
I know normally to do a count one would use

For count = 1 To 4
Next count

But what if I don't want to do 1-4, and I wanted to do like 1,2,5-8?
What would I use then?
--
Brian