PDA

View Full Version : Can't output values to cell



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

snb
08-12-2021, 04:18 AM
sn = cells(2,1).resize(10002,3)

for j=1 to ubound(sn)
if instr("LuxWarChi",left(sn(j,1),3))*instr("DüsFar",left(sn(j,2),3)) then sn(j,1)=sn(j,3)
next

cells(2,8).resize(10002) = sn

p45cal
08-12-2021, 07:03 AM
Cross posted in several places.

Paul_Hossler
08-12-2021, 11:38 AM
Hi,

I have tried everything, but my code just won't work:

Pls help

Welcome to the forum

Take a minute to read the FAQs at the link in my signature, especially the parts about using CODE tags and cross-posting in other forums