1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub UserForm_Initialize()
Dim x As Long 'num ligne tableau,
Dim i As Long 'num ligne liste déroulante
Dim f As Worksheet, y As Integer
Set f = Sheets("PV")
f.Activate
Me.lstpv.ListIndex = 0
i = Me.lstpv.ListIndex
x = 8 + i
f.Cells(x, 1).Select
Me.txt1.Value = f.Range("C" & x).Value
Me.txt2.Value = f.Range("D" & x).Value
Me.txt3.Value = f.Range("G" & x).Value
Me.txt4.Value = f.Range("H" & x).Value
Me.txt5.Value = Format(f.Range("Q" & x).Value, "0.00" & " m²")
For y = 1 To 24
Me.Controls("pr" & y).Visible = False
Next y
End Sub |