Afficher un message

  #5 (permalink)  
Vieux 22/07/2008, 08h32
Youky
 
Messages: n/a
Par défaut Re: Problème pour créér dans le Registre Windows

Le rajout indiqué hier soir n'était pas correct, voici avec amélioration.
Si tu n'as pas d'onglets de masqué il te faut supprimer le -1 à
Sheets(Sheets.Count - 1).......aux 2 lignes
Youky

Sheets("Feuil1").Copy After:=Sheets(Sheets.Count)
fichier = ThisWorkbook.Name
Dim nf As String
an = Right(Year(Now), 2)
chemin = ThisWorkbook.Path
On Error Resume Next
canal = FreeFile
Open chemin & "\N°facture.txt" For Input As #canal
Input #canal, nf
Close #canal
If Left(nf, 2) = an Then
nf = CStr(an) & CStr(Right(nf + 1001, 3))
Else
nf = CStr(an) & CStr("001")
End If
Sheets(Sheets.Count - 1).[F12] = "D/" & an & "/" & Right(nf + 1001, 3)
Sheets(Sheets.Count - 1).Name = "D" & an & "_" & Right(nf + 1001, 3)
Open chemin & "\N°facture.txt" For Output As #canal
Print #canal, nf
Close #canal

>
>



Réponse avec citation
 
Page generated in 0,26715 seconds with 9 queries