G
garyusenet
Hello I dont understand for next, im trying to work with a series of
variable all of which increment by a certain number every interation.
what im trying to do
----------------------------
make a string consisting of the the contents of the 6th, 7th, 9th,
35th, 37th, 38th, 40th, 41st and 42nd columns or multiples of these
columns. Repeat this extraction until the end of the row is reached.
This is my code that doesn't work - can someone offer a fixed version
please.
======
Dim concat As String
For i = 6 To 6000 Step 6
For j = 7 To 6000 Step 7
For k = 9 To 6000 Step 9
For l = 35 To 6000 Step 35
For m = 37 To 6000 Step 37
For n = 38 To 6000 Step 38
For o = 40 To 6000 Step 40
For p = 41 To 6000 Step 41
For q = 42 To 6000 Step 42
concat = concat & Cells(2, i) & " " & Cells(2, j) & " " & Cells(2,
k) & " " & Cells(2, l) & " " & Cells(2, m) & " " _
& Cells(2, n) & " " & Cells(2, o) & " " & Cells(2, p) & " " &
Cells(2, q)
Next i
Next j
Next k
Next l
Next m
Next n
Next o
Next p
Next q
ActiveCell = makes
End Sub
=====================
T I A,
Gary.
variable all of which increment by a certain number every interation.
what im trying to do
----------------------------
make a string consisting of the the contents of the 6th, 7th, 9th,
35th, 37th, 38th, 40th, 41st and 42nd columns or multiples of these
columns. Repeat this extraction until the end of the row is reached.
This is my code that doesn't work - can someone offer a fixed version
please.
======
Dim concat As String
For i = 6 To 6000 Step 6
For j = 7 To 6000 Step 7
For k = 9 To 6000 Step 9
For l = 35 To 6000 Step 35
For m = 37 To 6000 Step 37
For n = 38 To 6000 Step 38
For o = 40 To 6000 Step 40
For p = 41 To 6000 Step 41
For q = 42 To 6000 Step 42
concat = concat & Cells(2, i) & " " & Cells(2, j) & " " & Cells(2,
k) & " " & Cells(2, l) & " " & Cells(2, m) & " " _
& Cells(2, n) & " " & Cells(2, o) & " " & Cells(2, p) & " " &
Cells(2, q)
Next i
Next j
Next k
Next l
Next m
Next n
Next o
Next p
Next q
ActiveCell = makes
End Sub
=====================
T I A,
Gary.