Bonjour,
Je voudrais rajouter dans la colone K du fichier excel les chiffre de 1 à 20 pour numéroter les lignes qui sont assigné.
Comment faire svp?
<hr size="2" width="100%" />
Private Sub Form_Load()
Dim WorkB As New Excel.Workbook
Dim WorkS As Excel.Worksheet
Dim i As Long, PLV As Long
On Error Resume Next
Set obExcelApp = GetObject(, "Excel.Application")
Sheets("Feuil1").Select
Text1 = Range("A1") + 1
commande.Show
Range("A1") = Text1
ActiveWorkbook.Save
Timer1.Interval = 100
Label1.Caption = ""
Application.ScreenUpdating = False
'Assigner les lignes au PO
'Set obExcelApp = GetObject.Sheets("Feuil1")
PLV = obExcelApp.Range("B65536").End(xlUp).Row + 1
For i = PLV To PLV + 19
obExcelApp.Cells(i, 1).Value = "PB"
obExcelApp.Cells(i, 2).Value = "'" & Format(Range("A1").Value, "00000")
Next i
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
<hr size="2" width="100%" />