Variable please help

Ken Hutchinson

XLDnaute Occasionnel
Hello,

Je refais un poste plus complet concernant mon problème.

Je dois corriger des ventes. Suivant le numéro de la semaine la correction à apporter est différente. je suis parti au départ sur une solution avec des filtres auto mais je ne m'en sors pas.

J'ai 11 semaines avec un paquet de données à chaque semaine.

Ya t'il un moyen plus simple de faire cela ?

Code:
Sub CorrigeNmoinsUn()

Dim NoSemaine1 As String
Dim NoSemaine2 As String
Dim NoSemaine3 As String
Dim NoSemaine4 As String
Dim NoSemaine5 As String
Dim NoSemaine6 As String
Dim NoSemaine7 As String
Dim NoSemaine8 As String
Dim NoSemaine9 As String
Dim NoSemaine10 As String
Dim NoSemaine11 As String


Dim Coeff1 As String
Dim Coeff2 As String
Dim Coeff3 As String
Dim Coeff4 As String
Dim Coeff5 As String
Dim Coeff6 As String
Dim Coeff7 As String
Dim Coeff8 As String
Dim Coeff9 As String
Dim Coeff10 As String
Dim Coeff11 As String



Coeff1 = Sheets("Feuil3").Range("W20").Value
Coeff2 = Sheets("Feuil3").Range("W22").Value
Coeff3 = Sheets("Feuil3").Range("W24").Value
Coeff4 = Sheets("Feuil3").Range("W26").Value
Coeff5 = Sheets("Feuil3").Range("W28").Value
Coeff6 = Sheets("Feuil3").Range("W30").Value
Coeff7 = Sheets("Feuil3").Range("W32").Value
Coeff8 = Sheets("Feuil3").Range("W34").Value
Coeff9 = Sheets("Feuil3").Range("W36").Value
Coeff10 = Sheets("Feuil3").Range("W38").Value
Coeff11 = Sheets("Feuil3").Range("W40").Value

NoSemaine1 = Sheets("Feuil3").Range("A20").Value
NoSemaine2 = Sheets("Feuil3").Range("A22").Value
NoSemaine3 = Sheets("Feuil3").Range("A24").Value
NoSemaine4 = Sheets("Feuil3").Range("A26").Value
NoSemaine5 = Sheets("Feuil3").Range("A28").Value
NoSemaine6 = Sheets("Feuil3").Range("A30").Value
NoSemaine7 = Sheets("Feuil3").Range("A32").Value
NoSemaine8 = Sheets("Feuil3").Range("A34").Value
NoSemaine9 = Sheets("Feuil3").Range("A36").Value
NoSemaine10 = Sheets("Feuil3").Range("A38").Value
NoSemaine11 = Sheets("Feuil3").Range("A40").Value


    Sheets("Coller Data").Select
    Range("A1:I1").Select
    Selection.AutoFilter
    

    
    Selection.AutoFilter Field:=2, Criteria1:=NoSemaine1
    Range("a1").Select
    Set MaPlage = ActiveCell.CurrentRegion
    nblignes2 = MaPlage.Rows.Count
    
    
Range("J2").Select
        For i = 2 To nblignes2
            ActiveCell.Formula = "=RC[-2]* & Coeff1 & "
    ActiveCell.Offset(1, 0).Select
    Next i

' ensuite j'avais l'intention de refaire 11 fois ce code avec les 10 autres variables.

End Sub
 

Ken Hutchinson

XLDnaute Occasionnel
Re : Variable please help

ben ça marche aussi... c'est trop cool !!

MERCI BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP BEAUCOUP :D
 

Discussions similaires

Statistiques des forums

Discussions
312 489
Messages
2 088 857
Membres
103 979
dernier inscrit
bderradji