Incrementation d'un numero de ligne

bonjour

j'ai cré un userform voir fichier

je n'arrive pas du tous a que chaque ligne dans l'onglet tableau quand je valide mon userform il place un en colonne B un numéro

exemple '000001'

et qu'a chaque nouvelle ligne il incrémente

Merci de votre aide

[url] https://www.cjoint.com/c/GKqmNQujUev

Bonjour

un début reste beaucoup à faire

crdlt,

André

Andre13 a écrit :

Bonjour

un début reste beaucoup à faire

crdlt,

André

bonjour

merci pour la petite mise en forme

je ne trouve pas le module ou le code qui permet incrémenté chaque ligne nouvelle

merci encore

Bonjour cbredeche.

Bonjour André.

Voici une solution :

Private Sub CommandButton1_Click()
Dim l_info As Integer
With ThisWorkbook.Worksheets("TABLEAU")
    l_info = .Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
    .Range("B" & l_info).Value = l_info - 1
    .Range("B" & l_info).NumberFormat = "000000"
    .Range("C" & l_info).Value = TextBoxCHT 'Nom du chargé de travaux'
    .Range("D" & l_info).Value = TextBoxTCHT 'Télephone Travaux "
    .Range("E" & l_info).Value = TextBoxSCHT 'SOCIETE'
    .Range("F" & l_info).Value = COMBOX1  'hABILITATION'
    .Range("G" & l_info).Value = TextBoxINT 'intervenant'
    .Range("H" & l_info).Value = TextBoxLOC 'local'
    .Range("I" & l_info).Value = TextBoxEQUI 'EQUIPEMENT'
    .Range("J" & l_info).Value = TextBoxCON 'CONTRAT / TRAVAUX'
    .Range("L" & l_info).Value = TextBoxCCS 'Nom du chargé de consignation'
    .Range("M" & l_info).Value = TextBoxTCHT 'Télephone consignation "
    .Range("N" & l_info).Value = TextBoxEXET 'commentaire execution travaux "
    .Range("O" & l_info).Value = TextBoxDIS 'disposition particulière "
    .Range("Q" & l_info).Value = CDate(TextBoxDF) 'date DU RENDU FIN DE TRAVAIL'
    .Range("R" & l_info).Value = TextBoxHF 'date DU RENDU FIN DE TRAVAIL'
    .Range("S" & l_info).Value = TextBoxURG 'DELAI DE RESITUTION EN CAS DURGENCE'
    .Range("T" & l_info).Value = CDate(TextBoxDAT) 'date de l'attestation '
    .Range("U" & l_info).Value = TextBoxHEUR 'heure DU RENDU FIN DE TRAVAIL'
    .Visible = True
End With
    Unload Me
End Sub
Rechercher des sujets similaires à "incrementation numero ligne"