Exécuter un macro pour les lignes qiu suivent

manue16

XLDnaute Nouveau
Bonjour,
J'ai enfin réussi a faire une macro pour importer des données dans un autre fichier Excel.
Maintenant j'aimerai que cette macro s'applique au ligne qui suivent la ligne ou le macro est enregistrée & :rolleyes:
C'est trés important !! MERCI de répondre au plus vite s'il vous plait ! :D:eek:

MERCIII ! :) :)
 

manue16

XLDnaute Nouveau
Re : Exécuter un macro pour les lignes qiu suivent

bonjour,

bien gentil, mais il n'y ni macro ni fichier joint, et ma boule de cristal est en panne ...

Bonjour,

Désolé ..:eek:
Voici ma macro :
Sub Macro4()
'
' Macro4 Macro
'

'
Workbooks.Open Filename:= _
"N:\LE FLOCH\06 COMMANDE\BC_2012\CDE 2012 modèle.xls"
Range("B4").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C8"
Range("A18").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C9"
Range("B18").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C1"
Range("C18").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C10"
Range("E18:F18").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C4"
Range("A23").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C5"
Range("E23").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C3"
Range("E23").Select
Selection.ClearContents
Range("B23:D23").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C3"
Range("E23").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C7"
Range("E24").Select
ActiveWindow.SmallScroll Down:=6
Range("F23").Select
ActiveWindow.SmallScroll Down:=-12
End Sub

Voila j'espère que sa peu aidé ! :D
 

mutzik

XLDnaute Barbatruc
Re : Exécuter un macro pour les lignes qiu suivent

bjr,

Workbooks.Open Filename:= _
"N:\LE FLOCH\06 COMMANDE\BC_2012\CDE 2012 modèle.xls"
Range("B4").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C8"
Range("A18").Select
ActiveCell.FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C9"

peut se remplacer par :
Workbooks.Open Filename:= "N:\LE FLOCH\06 COMMANDE\BC_2012\CDE 2012 modèle.xls"
Range("B4").FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C8"
Range("A18").FormulaR1C1 = "='[BASES DE DONNEES.xls]COMMANDES '!R456C9"

point besoin de select
je te laisse faire le reste ...
 

Discussions similaires

Statistiques des forums

Discussions
312 799
Messages
2 092 239
Membres
105 298
dernier inscrit
doudounapnap