Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

création d'un USEFORM contenant 2combobox

2 réponses
Avatar
CDAN
j'ai un useform et je veux inclure 2 combobox ayant un code qui se
ressemble. j'ai essayé pas mal de choses mais rien. j'ai du me raissoudre à
mettre a la place 1 bouton clic qui m'ouvre une combobox que j'ai mis dans
un autre USEFORM.
je ne sais pas si j'ai été assez clair, je suis débutant onc j'essaye de
comprendre, mais la ca fait 2 semaines et ?
pouvez vous m'aidez
cordialement Dan

2 réponses

Avatar
JB
Bonjour,

http://boisgontierjacques.free.fr/pages_site/formulairebases.htm

JB

On 19 août, 19:09, "CDAN" wrote:
j'ai un useform et je veux inclure 2 combobox ayant un code qui se
ressemble. j'ai essayé pas mal de choses mais rien. j'ai du me raissoud re à
mettre a la place 1 bouton clic qui m'ouvre une combobox que j'ai mis dans
un autre USEFORM.
je ne sais pas si j'ai été assez clair, je suis débutant onc j'essa ye de
comprendre, mais la ca fait 2 semaines et ?
pouvez vous m'aidez
cordialement Dan


Avatar
CDAN
merci pour ta réponse mais toujours le meme probleme. voila les codes que
jai:
je ne sais pas si ca peux aider, moi je bug
lorsque je le mets sur la meme page il n'est pas pris en compte, je penses
que ca viens du "Private Sub UserForm_Activate()"


Private Sub FIN_Click()
Application.ScreenUpdating = False
Unload VTT
Unload DOSSARD
Sheets("MENU").Select
Application.ScreenUpdating = True
End Sub

Private Sub CommandButton1_Click()
VTT.Show c'est le code de vtt que je veux inclure dans le useform, afin de
pouvoir utiliser l'un ou l'autre des temps, le code de VTT est a la fin
End Sub



Private Sub UserForm_Activate()

' Stopper le raffraichissement de l'affichage des pages
Application.ScreenUpdating = False

' Déclaration des variables
Dim nbr_inscript As Integer
Dim numeros_dossard As Integer

' Selection de la feuille DONNEES
Sheets("DONNEES").Select

' Lecture du nombre d'inscript
nbr_inscript = Cells(1, 14).Value

Range("a2").Select

' Entrée des numeros de dossard dans la liste déroulante
For I = 2 To nbr_incript + 1
numeros_dossard = Cells(I, 1).Value
N°DOSSARD.AddItem (numeros_dossard)
Next I

' Stopper le raffraichissement de l'affichage des pages
Application.ScreenUpdating = True

End Sub
Private Sub VALIDATION_Click()

Application.ScreenUpdating = False
chaine = N°DOSSARD


Sheets("DONNEES").Select
Columns("a:a").Select

If Not Selection.Find(What:=chaine, After:¬tiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:úlse) Is Nothing And chaine <> "" Then
Columns("a:a").Select
Selection.Find(What:=chaine, After:¬tiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:úlse).Activate


Y = ActiveCell.Row
Finish = Time ' Définit l'heure d' arrivee FINAL

If Cells(Y, 11).Value = "" Then

Cells(Y, 18).Value = Finish
TEMP = Cells(Y, 18).Value - Cells(1, 16).Value

Cells(Y, 11).Value = TEMP

End If
If Cells(Y, 10).Value = "" Then

Cells(Y, 18).Value = Finish
TEMP = Cells(Y, 18).Value - Cells(Y, 16).Value

Cells(Y, 10).Value = TEMP
Else
a = MsgBox("N°DOSSARD DEJA SAISIE", vbDefaultButton1, "ATENTION
!!!")

End If
Cells(2, 1).Select
Else

a = MsgBox("N°DOSSARD INEXISTANT", vbDefaultButton1, "ATENTION
!!!")

End If
Unload DOSSARD
DOSSARD.Show

Sheets("MENU").Select
Application.ScreenUpdating = True
End Sub

CODE VTT

Private Sub FIN_Click()
Application.ScreenUpdating = False
Unload VTT
Application.ScreenUpdating = True
End Sub

Private Sub UserForm_Activate()

' Stopper le raffraichissement de l'affichage des pages
Application.ScreenUpdating = False

' Déclaration des variables
Dim nbr_inscript As Integer
Dim numeros_dossard As Integer

' Selection de la feuille DONNEES
Sheets("DONNEES").Select

' Lecture du nombre d'inscript
nbr_inscript = Cells(1, 14).Value

Range("a2").Select

' Entrée des numeros de dossard dans la liste déroulante
For I = 2 To nbr_incript + 1
numeros_dossard = Cells(I, 1).Value
N°DOSSARD.AddItem (numeros_dossard)
Next I

' Stopper le raffraichissement de l'affichage des pages
Application.ScreenUpdating = True

End Sub
Private Sub VALIDATION_Click()

Application.ScreenUpdating = False
chaine = N°DOSSARD


Sheets("DONNEES").Select
Columns("a:a").Select

If Not Selection.Find(What:=chaine, After:¬tiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:úlse) Is Nothing And chaine <> "" Then
Columns("a:a").Select
Selection.Find(What:=chaine, After:¬tiveCell, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:úlse).Activate


Y = ActiveCell.Row
Finish = Time ' Définit l'heure d' arrivee

If Cells(Y, 9).Value = "" Then

Cells(Y, 16).Value = Finish
TEMP = Cells(Y, 16).Value - Cells(Y, 15).Value

Cells(Y, 9).Value = TEMP
Else
a = MsgBox("N°DOSSARD DEJA SAISIE", vbDefaultButton1, "ATENTION
!!!")

End If
Cells(2, 1).Select
Else

a = MsgBox("N°DOSSARD INEXISTANT", vbDefaultButton1, "ATENTION
!!!")

End If
Unload VTT
VTT.Show
'Sheets("MENU").Select
Application.ScreenUpdating = True
End Sub