Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Harish, see if this does what you want.
Sub terfuge() Dim j, k j = 1 k = 1 With ActiveSheet For j = 1 To 80 .Cells(j, 1) = j .Cells(j, 2) = k + 1 k = k + 1 If j 1 And j Mod 20 = 0 Then k = 1 End If Next End With End Sub "Harish" wrote: Hi Gary, your logic works correctly. I work with a automated testing software and I want to use your logic in that software. This software uses VB scripting language. I tried to implement your logic in it but it doesnt work. I want to mention that j = 1 to 20 for some time and then changes to j = 21 to 40 and then changes to 41 to 60. but k has to restart everytime j = 21, 41, 61 and so on....Here is my code and I would appreciate if you can correct the logic behind: For j = firstnum to secondnum If j mod(row_count-1) <0 Then k=j+1 invoice_array(j) = Browser("").Page("_3").Frame ("_sweview_3").WebTable("Select for MultiPay").GetCellData(k,5) Else k=j+1 invoice_array(j) = Browser("").Page("_3").Frame("_sweview_3").WebTabl e ("Select for MultiPay").GetCellData(k,5) k=0 End If End if k=k+1 Next firstnum and second are variables that keeps changing like i said before (1-20, 21-40, 41-60). Thanks for your help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
Loop to Filter, Name Sheets. If Blank, Exit Loop | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming |