Flash30005 ha scritto:ma se D8 non è un numero la cella F5 deve rimanere vuota o occupata dal prossimo numero trovato?
ciao
Ciao. Si la cella F5 deve essere occupata dal prossimo numero trovato.
Ieri, tra i vari tentativi sono riuscito ad ottenere il risultato voluto con queste righe di codice:
- Codice: Seleziona tutto
Dim wk1_esame As Workbook
Dim wk2_prosp As Workbook
Dim sh1_esame As Worksheet
Dim sh2_prosp As Worksheet
Set wk1_esame = ActiveWorkbook
Set wk2 = Workbooks.Open("C:\test1.xls")
Set sh2_prosp = Worksheets(1)
Set sh1_esame = ThisWorkbook.Worksheets(8)
riga = sh1_esame.Range("G65000").End(xlUp).Row
For x = 1 To 250
If sh2_prosp.Cells(8, 1 + x).Value > 1 And sh2_prosp.Cells(8, 1 + x).Value < 9999999 Then
riga = riga + 1
sh1_esame.Range("G" & riga) = sh2_prosp.Cells(8, 1 + x).Value
sh1_esame.Range("H" & riga) = sh2_prosp.Cells(9, 1 + x).Value
End If
Next x
Immagino che ci sia un codice più pulito e funzionale, quindi, attendo fiducioso.
Ciao e grazie.