PDA

View Full Version : Solved: for loop



waka
11-06-2009, 12:20 AM
Hi, i'm trying to achieve something look like the screen shot using 'for loop'.

my 'for loop' is poor. anyone can help ?:banghead:

here is my code


Dim r As Range
Dim i As Integer
r = Range("H2:H61")
With r
For c = 1 To 20
For i = 1 To 3
If i = 1 Then
.Cells = "Rev ('000)"
Else
If i = 2 Then
.Cells = "FEU"
Else
If i = 3 Then
.Cells = "Rev/F"
End If
Next i
Next c
End With

Bob Phillips
11-06-2009, 04:51 AM
Dim c As Long

For c = 2 To 61 Step 3

Cells(c, "h").Resize(3).Value = Application.Transpose(Array("Rev ('000)", "FEU", "Rev/F"))
Next c