Bonjour à tous,
Je reviens encore vers vous. J'ai un tableau(G5:AK45) dont je lis la première ligne avec un userform et je n'arrive pas a faire le bouton suivant malgré plusieurs recherche sur le sujet qui est bien garnie. Impossible de trouver un code simple pour l'imbriqué dans mon userform.
je vous remercie par avance.
ci-joint le code de l'userform:
Option Explicit
Dim dl%, j%, i%, c
Dim leNom As String, leMatricule As String, ligne%
Private Sub CommandButton1_Click() ' BOUTON SUIVANT QUE JE N'ARRIVE PAS A FAIRE
dl = Worksheets("SUIVI CONGES ET ABSENCES ANNUEL").Range("G5:AK5").Row
j = IIf(j = dl, 2, j + 1)
With Worksheets("SUIVI CONGES ET ABSENCES ANNUEL").Range("G" & j)
For i = 1 To 31
Me.Controls("TextBox" & i).Value = .Cells(i)
Next i
End With
End Sub
Private Sub UserForm_Activate()
With Sheets("SUIVI CONGES ET ABSENCES ANNUEL").Range("D5:D45")
For c = 1 To 41
ComboBox1.AddItem .Cells(c).Value
Next
End With
End Sub
Private Sub UserForm_Initialize()
Dim i%
With Worksheets("SUIVI CONGES ET ABSENCES ANNUEL").Range("G3:AK3")
For i = 1 To 31
Me.Controls("Label" & i).Caption = .Cells(i)
Next i
End With
With Worksheets("SUIVI CONGES ET ABSENCES ANNUEL").Range("G5:AK45")
For i = 1 To 31
Me.Controls("TextBox" & i) = .Cells(i)
Next i
End With
End Sub
Daniel