
Sub prev()
pippo = 21
'ipt = 50
For r = 7 To 16
If Cells(r, 17).Value > 0 Then
Foglio8.Cells(pippo, 6).Value = Cells(r, 17).Value
Foglio8.Cells(pippo, 3).Value = Cells(r, 10).Value
Foglio8.Cells(pippo, 7).Value = Cells(r, 12).Value
'Foglio8.Cells(ipt, 10).Value = Cells(r, 18).Value
pippo = pippo + 1
End If
Next r
End Sub
|
Ho creato questo codice, ma vorrei che lo stesso cercasse anche, sempre dalla riga 7 to 16 un'altra variabile, p.es if cells(r,4)value=<53 then
foglio8.cells(i,10).value=cells(r,18)value
else
foglio8.cells(i,10).value=cells(r,18)value*(r,19)value.
purtrommo non funziona.
mi potete dare una soluzione?
Sub prev()
pippo = 21
'ipt = 50
For r = 7 To 16
If Cells(r, 17).Value > 0 Then
Foglio8.Cells(pippo, 6).Value = Cells(r, 17).Value
Foglio8.Cells(pippo, 3).Value = Cells(r, 10).Value
Foglio8.Cells(pippo, 7).Value = Cells(r, 12).Value
'Foglio8.Cells(ipt, 10).Value = Cells(r, 18).Value
pippo = pippo + 1
End If
Next r
End Sub
|
Sub prev()
Dim pippo As Long
Dim i As Long
Dim r As Variant
pippo = 21
i = 50
For r = 7 To 16
If Cells(r, 4) <= 53 Then
Foglio8.Cells(i, 10) = Foglio8.Cells(r, 18)
Else
Foglio8.Cells(i, 10) = Foglio8.Cells(r, 18) * Cells(r, 19)
End If
If Cells(r, 17).Value > 0 Then
Foglio8.Cells(pippo, 6).Value = Foglio8.Cells(r, 17).Value
Foglio8.Cells(pippo, 3).Value = Foglio8.Cells(r, 10).Value
Foglio8.Cells(pippo, 7).Value = Foglio8.Cells(r, 12).Value
'Foglio8.Cells(ipt, 10).Value = Cells(r, 18).Value
End If
pippo = pippo + 1
i = i + 1
Next r
End Sub
|
