John18188181
08-12-2021, 02:04 AM
Hi,
I have tried everything, but my code just won't work:
Sub Fly()
Dim r As Integer
Dim c As Integer
Dim Number As Single
Number = 10002
ReDim Flylist(1 To Number, 1 To 3) As String
For r = 1 To Number
For c = 1 To 3
Flylist(r, c) = Cells(r + 1, c)
Next c
Next r
For r = 1 To Number
For c = 1 To 3
If ((Cells(r + 1, 1) = "Luxembourg") Or (Cells(r + 1, 1) = "Warsaw") Or (Cells(r + 1, 1) = "Chicago")) _
And ((Cells(r + 1, 2) = "Dusseldorf") Or (Cells(r + 1, 2) = "Faroe Islands")) Then
Cells(r + 1, c + 8) = Flylist(r, c)
End If
Next c
Next r
End Sub
Pls help
I have tried everything, but my code just won't work:
Sub Fly()
Dim r As Integer
Dim c As Integer
Dim Number As Single
Number = 10002
ReDim Flylist(1 To Number, 1 To 3) As String
For r = 1 To Number
For c = 1 To 3
Flylist(r, c) = Cells(r + 1, c)
Next c
Next r
For r = 1 To Number
For c = 1 To 3
If ((Cells(r + 1, 1) = "Luxembourg") Or (Cells(r + 1, 1) = "Warsaw") Or (Cells(r + 1, 1) = "Chicago")) _
And ((Cells(r + 1, 2) = "Dusseldorf") Or (Cells(r + 1, 2) = "Faroe Islands")) Then
Cells(r + 1, c + 8) = Flylist(r, c)
End If
Next c
Next r
End Sub
Pls help