Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
A+ Nicolas B.
Bonjour à tous
Voici le lien d'un sujet dans un forum, pour que vous puissez voir le code.
Sub MeF()
Dim i As Integer, j As Integer
Dim l As Integer
Dim sh0 As Worksheet, sh1 As Worksheet
Application.ScreenUpdating = False
Set sh0 = ActiveSheet
Set sh1 = Sheets.Add
For i = 2 To sh0.Range("A1").End(xlDown).Row
For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2
l = l + 1
sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value
sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value
sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value
Next
Next
Application.ScreenUpdating = True
End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la
numérotation, mais tu pourras rajouter toi-même la ligne de code qui
manque pour numéroter.
A+
Nicolas B.
Bonjour à tous
Voici le lien d'un sujet dans un forum, pour que vous puissez voir le code.
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
A+ Nicolas B.
Bonjour à tous
Voici le lien d'un sujet dans un forum, pour que vous puissez voir le code.
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
Sub MeF()
Dim i As Integer, j As Integer
Dim l As Integer
Dim sh0 As Worksheet, sh1 As Worksheet
Application.ScreenUpdating = False
Set sh0 = ActiveSheet
Set sh1 = Sheets.Add
For i = 2 To sh0.Range("A1").End(xlDown).Row
For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2
l = l + 1
sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value
sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value
sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value
Next
Next
Application.ScreenUpdating = True
End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la
numérotation, mais tu pourras rajouter toi-même la ligne de code qui
manque pour numéroter.
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
nbcol = 3 ' nombre de couples de données à lire ope/tps nbproduit = 4 ' nombre de produits
celluledepart = "C19" ' cellule de départ du tableau à remplir cellulealire = "A2" ' cellule de départ des données à parcourir
For prod = 0 To nbproduit For i = 0 To nbcol - 1 Range(celluledepart).Offset(i + (prod * nbcol), 0).Value = Range(cellulealire).Offset(0 + prod, 0).Value Range(celluledepart).Offset(i + (prod * nbcol), 1).Value = 10 + 10 * i Range(celluledepart).Offset(i + (prod * nbcol), 2).Value = Range(cellulealire).Offset(0 + prod, 2 + (5 * i)) Range(celluledepart).Offset(i + (prod * nbcol), 3).Value = Range(cellulealire).Offset(0 + prod, 4 + (5 * i)) Next i Next prod
End Sub
J'ai encore un probléme pour faire pointer cellulealire et celluledepart dans deux feuilles différentes.
Meric pour votre aide.
Olivier
Bonjour *Nicolas B.* , donc, tu nous dis :
Salut,
Quelque chose comme ça ?
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
nbcol = 3 ' nombre de couples de données à lire ope/tps
nbproduit = 4 ' nombre de produits
celluledepart = "C19" ' cellule de départ du tableau à remplir
cellulealire = "A2" ' cellule de départ des données à parcourir
For prod = 0 To nbproduit
For i = 0 To nbcol - 1
Range(celluledepart).Offset(i + (prod * nbcol), 0).Value =
Range(cellulealire).Offset(0 + prod, 0).Value
Range(celluledepart).Offset(i + (prod * nbcol), 1).Value = 10 + 10 * i
Range(celluledepart).Offset(i + (prod * nbcol), 2).Value =
Range(cellulealire).Offset(0 + prod, 2 + (5 * i))
Range(celluledepart).Offset(i + (prod * nbcol), 3).Value =
Range(cellulealire).Offset(0 + prod, 4 + (5 * i))
Next i
Next prod
End Sub
J'ai encore un probléme pour faire pointer cellulealire et celluledepart
dans deux feuilles différentes.
Meric pour votre aide.
Olivier
Bonjour *Nicolas B.* , donc, tu nous dis :
Salut,
Quelque chose comme ça ?
Sub MeF()
Dim i As Integer, j As Integer
Dim l As Integer
Dim sh0 As Worksheet, sh1 As Worksheet
Application.ScreenUpdating = False
Set sh0 = ActiveSheet
Set sh1 = Sheets.Add
For i = 2 To sh0.Range("A1").End(xlDown).Row
For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2
l = l + 1
sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value
sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value
sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value
Next
Next
Application.ScreenUpdating = True
End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la
numérotation, mais tu pourras rajouter toi-même la ligne de code qui
manque pour numéroter.
nbcol = 3 ' nombre de couples de données à lire ope/tps nbproduit = 4 ' nombre de produits
celluledepart = "C19" ' cellule de départ du tableau à remplir cellulealire = "A2" ' cellule de départ des données à parcourir
For prod = 0 To nbproduit For i = 0 To nbcol - 1 Range(celluledepart).Offset(i + (prod * nbcol), 0).Value = Range(cellulealire).Offset(0 + prod, 0).Value Range(celluledepart).Offset(i + (prod * nbcol), 1).Value = 10 + 10 * i Range(celluledepart).Offset(i + (prod * nbcol), 2).Value = Range(cellulealire).Offset(0 + prod, 2 + (5 * i)) Range(celluledepart).Offset(i + (prod * nbcol), 3).Value = Range(cellulealire).Offset(0 + prod, 4 + (5 * i)) Next i Next prod
End Sub
J'ai encore un probléme pour faire pointer cellulealire et celluledepart dans deux feuilles différentes.
Meric pour votre aide.
Olivier
Bonjour *Nicolas B.* , donc, tu nous dis :
Salut,
Quelque chose comme ça ?
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
Voici sa réponse
http://www.informatiquepourtous.com/services/forum/index.php?showtopic188&view=findpost&pR826 [CIT] Mais je n'arrive à faire pointer cellualire et celluledepart dans 2 feuilles différentes.
Sub MeF()
Dim i As Integer, j As Integer
Dim l As Integer
Dim sh0 As Worksheet, sh1 As Worksheet
Application.ScreenUpdating = False
Set sh0 = ActiveSheet
Set sh1 = Sheets.Add
For i = 2 To sh0.Range("A1").End(xlDown).Row
For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2
l = l + 1
sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value
sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value
sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value
Next
Next
Application.ScreenUpdating = True
End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la
numérotation, mais tu pourras rajouter toi-même la ligne de code qui
manque pour numéroter.
Voici sa réponse
http://www.informatiquepourtous.com/services/forum/index.php?showtopic188&view=findpost&pR826
[CIT]
Mais je n'arrive à faire pointer cellualire et celluledepart dans 2 feuilles
différentes.
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
Voici sa réponse
http://www.informatiquepourtous.com/services/forum/index.php?showtopic188&view=findpost&pR826 [CIT] Mais je n'arrive à faire pointer cellualire et celluledepart dans 2 feuilles différentes.
nbcol = 12 ' nombre de couples de données à lire ope/tps nbproduit = 18 ' nombre de produits
nomclasseur = "DUBILAODB1.xls" ' nom du classeur où se trouve les données nomfeuille = "Feuil1" ' nom de la feuille
celluledepart = "C19" ' cellule de départ du tableau à remplir cellulealire = "A2" ' cellule de départ des données à parcourir
For prod = 0 To nbproduit For i = 0 To nbcol - 1 Range(celluledepart).Offset(i + (prod * nbcol), 0).Value = Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 + prod, 0).Value Range(celluledepart).Offset(i + (prod * nbcol), 1).Value = 10 + 10 * i Range(celluledepart).Offset(i + (prod * nbcol), 2).Value = Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 + prod, 2 + (5 * i)) Range(celluledepart).Offset(i + (prod * nbcol), 3).Value = Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 + prod, 4 + (5 * i)) Next i Next prod
End Sub[/code]
Merci à tous pour votre aide.
Bonjour *Nicolas B.* , donc, tu nous dis :
Salut,
Quelque chose comme ça ?
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
Voici sa réponse
http://www.informatiquepourtous.com/services/forum/index.php?showtopic188&view=findpost&pR826 [CIT] Mais je n'arrive à faire pointer cellualire et celluledepart dans 2 feuilles différentes.
nbcol = 12 ' nombre de couples de données à lire ope/tps
nbproduit = 18 ' nombre de produits
nomclasseur = "DUBILAODB1.xls" ' nom du classeur où se trouve les données
nomfeuille = "Feuil1" ' nom de la feuille
celluledepart = "C19" ' cellule de départ du tableau à remplir
cellulealire = "A2" ' cellule de départ des données à parcourir
For prod = 0 To nbproduit
For i = 0 To nbcol - 1
Range(celluledepart).Offset(i + (prod * nbcol), 0).Value =
Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 +
prod, 0).Value
Range(celluledepart).Offset(i + (prod * nbcol), 1).Value = 10 + 10 * i
Range(celluledepart).Offset(i + (prod * nbcol), 2).Value =
Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 +
prod, 2 + (5 * i))
Range(celluledepart).Offset(i + (prod * nbcol), 3).Value =
Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 +
prod, 4 + (5 * i))
Next i
Next prod
End Sub[/code]
Merci à tous pour votre aide.
Bonjour *Nicolas B.* , donc, tu nous dis :
Salut,
Quelque chose comme ça ?
Sub MeF()
Dim i As Integer, j As Integer
Dim l As Integer
Dim sh0 As Worksheet, sh1 As Worksheet
Application.ScreenUpdating = False
Set sh0 = ActiveSheet
Set sh1 = Sheets.Add
For i = 2 To sh0.Range("A1").End(xlDown).Row
For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2
l = l + 1
sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value
sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value
sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value
Next
Next
Application.ScreenUpdating = True
End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la
numérotation, mais tu pourras rajouter toi-même la ligne de code qui
manque pour numéroter.
Voici sa réponse
http://www.informatiquepourtous.com/services/forum/index.php?showtopic188&view=findpost&pR826
[CIT]
Mais je n'arrive à faire pointer cellualire et celluledepart dans 2 feuilles
différentes.
nbcol = 12 ' nombre de couples de données à lire ope/tps nbproduit = 18 ' nombre de produits
nomclasseur = "DUBILAODB1.xls" ' nom du classeur où se trouve les données nomfeuille = "Feuil1" ' nom de la feuille
celluledepart = "C19" ' cellule de départ du tableau à remplir cellulealire = "A2" ' cellule de départ des données à parcourir
For prod = 0 To nbproduit For i = 0 To nbcol - 1 Range(celluledepart).Offset(i + (prod * nbcol), 0).Value = Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 + prod, 0).Value Range(celluledepart).Offset(i + (prod * nbcol), 1).Value = 10 + 10 * i Range(celluledepart).Offset(i + (prod * nbcol), 2).Value = Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 + prod, 2 + (5 * i)) Range(celluledepart).Offset(i + (prod * nbcol), 3).Value = Workbooks(nomclasseur).Worksheets(nomfeuille).Range(cellulealire).Offset(0 + prod, 4 + (5 * i)) Next i Next prod
End Sub[/code]
Merci à tous pour votre aide.
Bonjour *Nicolas B.* , donc, tu nous dis :
Salut,
Quelque chose comme ça ?
Sub MeF() Dim i As Integer, j As Integer Dim l As Integer Dim sh0 As Worksheet, sh1 As Worksheet Application.ScreenUpdating = False Set sh0 = ActiveSheet Set sh1 = Sheets.Add For i = 2 To sh0.Range("A1").End(xlDown).Row For j = 2 To sh0.Cells(i, 1).End(xlToRight).Column Step 2 l = l + 1 sh1.Cells(l, 1).Value = sh0.Cells(i, 1).Value sh1.Cells(l, 3).Value = sh0.Cells(i, j).Value sh1.Cells(l, 4).Value = sh0.Cells(i, j + 1).Value Next Next Application.ScreenUpdating = True End Sub
Pour la colonne B, j'ai pas compris comment fonctionnait la numérotation, mais tu pourras rajouter toi-même la ligne de code qui manque pour numéroter.
Voici sa réponse
http://www.informatiquepourtous.com/services/forum/index.php?showtopic188&view=findpost&pR826 [CIT] Mais je n'arrive à faire pointer cellualire et celluledepart dans 2 feuilles différentes.