Besoin d'aide dans une macro

G

GRUMLY

Guest
Bonjour,

Je me sert d'une macro qui est la suivante :

Private Sub CommandButton1_Click()
Dim Lig, Col, x0, x1 As Long
Dim b0, b1, b2, d, dv As String
Dim Fic, adxirs, adxifs As String

Fic = 'C:\\CDESTA04102005.txt'
d = Chr$(34)
dv = d + ';'

Sheets('Feuil1').Activate
Range('A1').Activate
Open Fic For Output As #1
b0 = ''
x0 = 0
Lig = 1
Do While ActiveCell.Offset(Lig, 0).Text <> ''
b1 = ActiveCell.Offset(Lig, 0).Text
x0 = x0 + 1
If x0 = 185 Then
x0 = 0
b0 = ''
End If
If b0 <> b1 Then
'---- nouvelle commande
Print #1, d & 'E' & dv;
Print #1, d & ActiveCell.Offset(Lig, 0).Text & dv;
Print #1, d & ActiveCell.Offset(Lig, 2).Text & dv;
Print #1, d & ActiveCell.Offset(Lig, 1).Text & d
b0 = b1
End If
Print #1, d & 'L' & dv;
Print #1, d & ActiveCell.Offset(Lig, 3).Text & dv;
Print #1, d & ActiveCell.Offset(Lig, 4).Text & d
Lig = Lig + 1
Loop
Close #1
MsgBox ('Fichier ' & Fic & ' généré !')
End Sub

Mon hic c'est que mon fichier actuelleest

fourn code n°cde ref qté ....>

J'ai la nécessité de rajouté une colonne date apres la colonne qté.
lorsque je genere mon fichier cela ne prend pas en compte ma nouvelle colonne cela ce limite à 5 colonne.

Pouvez vous m'aider ???

Merci d'avance...
 

Discussions similaires

Statistiques des forums

Discussions
312 676
Messages
2 090 803
Membres
104 670
dernier inscrit
Djnic30