Private Sub ListBox1_Click()
Dim titolo, image, protagonisti, irow
titolo = ListBox1.Value
image = ThisWorkbook.Path & "image"
For irow = 1 To 200000
If Sheets(1).Cells(irow, 14) = "" Then GoTo 5
If Sheets(1).Cells(irow, 14) = titolo Then Exit For
Next
Sheets(2).TextBox1 = Sheets(1).Cells(irow, 1) 'titolo
Sheets(2).TextBox2 = "GENERE: " & Sheets(1).Cells(irow, 2) 'genere
Sheets(2).TextBox3 = "DURATA: " & Sheets(1).Cells(irow, 3) & " ore" 'durata'
Sheets(2).TextBox4 = "ANNO D'USCITA: " & Sheets(1).Cells(irow, 4) 'anno d'uscita
Sheets(2).TextBox5 = "REGIA: " & Sheets(1).Cells(irow, 5) 'regia
protagonisti = "PROTAGONISTI: " & Chr(10)
protagonisti = protagonisti & Sheets(1).Cells(irow, 6) & Chr(10)
protagonisti = protagonisti & Sheets(1).Cells(irow, 7) & Chr(10)
protagonisti = protagonisti & Sheets(1).Cells(irow, 8) & Chr(10)
protagonisti = protagonisti & Sheets(1).Cells(irow, 9) & Chr(10)
protagonisti = protagonisti & Sheets(1).Cells(irow, 10) & Chr(10)
Sheets(2).TextBox6 = protagonisti
Sheets(2).TextBox7 = Sheets(1).Cells(irow, 12) 'trama
Sheets(2).TextBox7.Height = Len(Sheets(1).Cells(irow, 12)) / 105 * 48
Sheets(2).TextBox8 = "TITOLO ORGINALE: " & Sheets(1).Cells(irow, 11) 'titolo originale
image = image & Sheets(1).Cells(irow, 13) & ".jpg"
Sheets(2).Range("a1") = image
Sheets(2).Image1.Picture = LoadPicture(image)
5
End Sub
|