.xls ==> .QIF : boucle en VBA

Fermé
chimay - 18 mars 2011 à 11:39
 chimay - 18 mars 2011 à 13:58
Bonjour,

J'essaye de me constituer un fichier .QIF à partir de données Excel.

Avant
D21/08'2006 T- 18.57 PFranprix LAlimentation:Épicerie ^
D24/04'2007 T- 19.25 PFranprix LAlimentation:Épicerie ^

Après
D21/08'2006
T- 18.57
PFranprix
LAlimentation:Épicerie
^
D24/04'2007
T- 19.25
PFranprix
LAlimentation:Épicerie
^

J'ai enregistré une macro, et je voudrais y mettre une boucle, mais je ne sais pas comment le faire.

Sub Macro3()
'
' Macro3 Macro
'

'
Range("A1:E1").Select
Selection.Copy
Range("G1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A2:E2").Select
Application.CutCopyMode = False
Selection.Copy
Range("G6").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
End Sub


Quelqu'un a-t-il une idée ?
Merci d'avance.
A voir également:

2 réponses

Bonjour,

Ca devrait marcher comme ça:

Derlig = Range("A65536").End(xlUp).Row

For i = 1 To Derlig
    Plage = "A" & i & ":E" & i
    Range(Plage).Select
    Selection.Copy
    Range("G" & i * 5 - 4).Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=True
Next i


Bonne journée
0
Merci beaucoup.
Cela répond parfaitement à mon besoin.
0