View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Hardy[_5_] Hardy[_5_] is offline
external usenet poster
 
Posts: 1
Default For Each...Next statement

Hi,

Not that familiar with loops etc.

I think what I need is for..next statement loop, as this is for each
element in group.

My group would be list of varialbes (integers) that are non-sequential,
that are gained via match function in VBA (they are column numbers of
data).

So, looping through 1,4,7,9,15 etc., rather than 1,2,3,4 etc.

I have searched and searched but cannot get my head round how to create
group or array to achieve this.

The code that I want to use in my loop is below (not that relevant to
question);

Set riBoxxFilteredCol = Intersect(ActiveSheet.Columns(iIBOXXColNo),
rng) ' Loops through series of integer variables
riBoxxFilteredCol.Copy
Worksheet(NowSheetName).Activate
Range("B1").Activate
ActiveCell.Offset(0, iNowColNo).Activate ' This is varialbe in loop (1
to 9)

It's iBOXXColNo that will loop through non-sequential list mentioned
above.

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/