Bonjour,
j'espère que tu pourras venir à mon soutien. Je galère avec VBA Excel. je suis débutante et je ne m'en sors pas.
Mon problème se situe avec les boucles, je ne sais laquelle utiliser. Je souhaite faire défilé les colonnes d'une feuille et je n'y arrive pas. Ci-dessus, tous les éléments pour comprendre.
J'ai une feuille avec une liste de la sorte:
feuille ("ListHVC"):
grand magasin (colonneA) 1er petit magasin (colonne B) 2eme petit magasin (colonne C) ect...
correspondant au grand magasin de la colonne A
A Novo Digicom (1361) xDRSL/UK A N
Fone Logistics (1363) DRSL/UK Fone
Total Repair Solutions (1371) xDRSL/UK Total
Carphone Warehouse (1373) DRSL/UK Carphone
SL/UK Kuehne SL/UK Kuehne & N ACR Logistics(Kue
MPRC UK (1374) xDRSL/UK MPR
SL/UK Sacel IRL - out SL/UK SACEL Polska in
Ce que je veux:
quand je sélectionne un grand magasin (récupéré par le numéro de la ligne par la variable: Ligne), je souhaite parcourir les colonnes à partir de la colonne B et correspondant au grand magasin. Dans le code ci-dessus, la varible "j" me permet de faire défiler les colonnes.
Quelle boucle dois-je utiliser?
Voici mon code qui ne fonctionne avec Do While...
Dim j As Integer
Dim ligne As Integer
j = 2
ligne = Sheets("ListSLs").Range("e2")
Do While Sheets("ListSLs").Cells(ligne, j) <> "" '!!!MON PROBLEME EST ICI!!!!
'ensuite faire les actions suivante #NORMALEMENT CELA FONCTIONNE TRES BIEN
'----------------------------------------------------------------------------------------
' * CREATION OF THE MASTER *
'----------------------------------------------------------------------------------------
'Copy of the overview in another sheet
Sheets("OVcube").Select
Range("C1:AB100").Select
Selection.Copy
Sheets("OVmaster").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
'Copy of the TOP10cube in another sheet
Sheets("TOP10cube").Select
Range("G1:AB100").Select
Selection.Copy
Sheets("TOP10master").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
'Copy of the SCcube in another sheet
Sheets("SCcube").Select
Range("A1:AB100").Select
Selection.Copy
Sheets("SCmaster").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
'Copy of the SPcube in another sheet
Sheets("SPcube").Select
Range("B22:AB100").Select
Selection.Copy
Sheets("SPmaster").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
'----------------------------------------------------------------------------------------
' * CREATION OF A FILE FOR THE LMU *
'----------------------------------------------------------------------------------------
'To rename all the sheets in order to have any problem if we do the loop again
Worksheets(Array("OVmaster", "TOP10master", "SCmaster", "SPmaster")).Copy
Sheets("OVmaster").Select
Sheets("OVmaster").Name = "Overview (" & j & ")"
Sheets("TOP10master").Select
Sheets("TOP10master").Name = "TOP10 (" & j & ")"
Sheets("SCmaster").Select
Sheets("SCmaster").Name = "Symptom-codes (" & j & ")"
Sheets("SPmaster").Select
Sheets("SPmaster").Name = "TOP Spare parts (" & j & ")"
j = j + 1
Loop
Je vous remercie beaucoup pour votre aide, je cherche depuis un bout de temps et je ne sais pas ce qu'il ne fonctionne pas. C'est pas facile qt on est débutant!
Configuration: Windows XP
Firefox 2.0.0.14
Excel 2007 VBA