Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi NG
I have this macro [simplified] Sub test() dim RRange as range set RRange=Range("A1:A1000") dim CellA as range '// Loop 1 for each CellA in RRange '// CellA = Range("A1") '// Loop2 dim CellA2 as range for each CellA2 in rrange.offset(1,0) '// doing something and now I want CellA to continue with Range("A10"), '// I will use a counter and Cells(counter,1) '// Is it possible, and how ? '// Next time in loop2 I want CellA=Range("A25") exit for next cellA2 '// something like: CellA=Range("A10") next CellA -- Best regards Joergen Bondesen |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think your codde would be better structuresd like this
RowCountColA = 1 do while RowCountColA <= 1000 CellA = Range("A" & RowCountColA) RowCountColB = 1 do while RowCountColB <= 1000 CellB = Range("B" & RowCountColB) RowcountColB = RowCountColB + 1 loop RowcountColA = RowCountColA + 1 loop "Joergen Bondesen" wrote: Hi NG I have this macro [simplified] Sub test() dim RRange as range set RRange=Range("A1:A1000") dim CellA as range '// Loop 1 for each CellA in RRange '// CellA = Range("A1") '// Loop2 dim CellA2 as range for each CellA2 in rrange.offset(1,0) '// doing something and now I want CellA to continue with Range("A10"), '// I will use a counter and Cells(counter,1) '// Is it possible, and how ? '// Next time in loop2 I want CellA=Range("A25") exit for next cellA2 '// something like: CellA=Range("A10") next CellA -- Best regards Joergen Bondesen |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joel.
Thanks. -- Best regards Joergen Bondesen "Joel" skrev i en meddelelse ... I think your codde would be better structuresd like this RowCountColA = 1 do while RowCountColA <= 1000 CellA = Range("A" & RowCountColA) RowCountColB = 1 do while RowCountColB <= 1000 CellB = Range("B" & RowCountColB) RowcountColB = RowCountColB + 1 loop RowcountColA = RowCountColA + 1 loop "Joergen Bondesen" wrote: Hi NG I have this macro [simplified] Sub test() dim RRange as range set RRange=Range("A1:A1000") dim CellA as range '// Loop 1 for each CellA in RRange '// CellA = Range("A1") '// Loop2 dim CellA2 as range for each CellA2 in rrange.offset(1,0) '// doing something and now I want CellA to continue with Range("A10"), '// I will use a counter and Cells(counter,1) '// Is it possible, and how ? '// Next time in loop2 I want CellA=Range("A25") exit for next cellA2 '// something like: CellA=Range("A10") next CellA -- Best regards Joergen Bondesen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to add a "+" to a number in a cell€Ź | Excel Worksheet Functions | |||
Automatic change of cells background color | Excel Worksheet Functions | |||
MAX €śevery 4th cell€ť in a row | Excel Discussion (Misc queries) | |||
SUM €śevery 4th cell€ť in a row | Excel Discussion (Misc queries) | |||
If cellA is blank or 0 then cellB is blank | Excel Worksheet Functions |