benjamin132
New Member
- Joined
- Jun 8, 2022
- Messages
- 21
- Platform
- Windows
Hi everyone,
I have a problem with listview.
I want a table with some informations in my sheets when i click in a button "CommandButton1" but i have an error 424 object required here :
Someone know what is my problem ?
Thanks by advance
here is my code :
I have a problem with listview.
I want a table with some informations in my sheets when i click in a button "CommandButton1" but i have an error 424 object required here :
Someone know what is my problem ?
Thanks by advance
here is my code :
VBA Code:
Private Sub CommandButton1_Click()
If Len(Num_SI) = 0 Then
MsgBox "Vous devez remplir le champ commune avec la liste déroulante"
ElseIf Len(ComboBox1) = 0 Then
MsgBox "Vous devez remplir le champ NUM_PE avec la liste déroulante"
Else
Sheets("David").Range("I4") = ComboBox1
Sheets("David").Range("I5") = ComboBox2
If Sheets("David").Range("I6") = 1 Then
MsgBox ("Ce site n'existe pas")
Else
If (IsError(Sheets("David").Range("I10"))) Then
With ListView1
With .ColumnHeaders
.Clear
.Add , , "Nom", 80
.Add , , "Ville", 50
.Add , , "Age", 50
End With
With .ListItems
.Add , , "Riri"
End With
.ListSubItems(1).Add , , Sheets("David").Range("I7")
.ListSubItems(1).Add , , Sheets("David").Range("I8")
.ListSubItems(1).Add , , Round(Sheets("David").Range("I9") * 100, 2)
End With
Else
MsgBox ("Le site indiqué a " & Sheets("David").Range("I7") & " Emplacements disponibles, " & Sheets("David").Range("I8") & " Nb de baies Max avec " & Round(Sheets("David").Range("I9") * 100, 2) & "% d'occupation 3YP et un taux d'occupation REPO de " & Round(Sheets("David").Range("I10") * 100, 2) & "%")
Unload Me
End If
End If
End If
End Sub