WDAndCo
XLDnaute Impliqué
Bonsoir le forum.
Si F est en E2 et
Colonne$ = Cells(2, 5) et
Code(Cells(2, 5))-96 est en F2 et
nc = Cells(2, 6)
J'ai donc Colonne$ = F et nc = 6
Sub Ouvre()
Cells(2, 3) = Feuil2.Name
Feuille$ = Cells(2, 3)
Colonne$ = Cells(2, 5)
nc = Cells(2, 6)
Feuil2.Select
Columns(Colonne$).Select
Selection.Copy
Selection.Insert Shift:=xlToRight
Range(Colonne$ & "2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=LOOKUP(RC[1],Base!R1C1:R24C1,Base!R1C2:R24C2)"
Selection.AutoFill Destination:=Range("F2:F1000") ' Comment mettre cela avec la variable Colonne$ ou nc ?
Range("F2:F1000").Select ' Comment mettre cela avec la variable Colonne$ ou nc ?
Columns(Colonne$).EntireColumn.AutoFit
Columns(Colonne$).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range(Colonne$ & "1").Select
Application.CutCopyMode = False
Columns("G:G").Select ' Comment mettre cela avec la variable Colonne$ + 1 à droite soit G ou nc +1?
Selection.EntireColumn.Hidden = True
End Sub
Comment les mettent en place ces variables dans ce code ?
D'avance merci
Dominique
Si F est en E2 et
Colonne$ = Cells(2, 5) et
Code(Cells(2, 5))-96 est en F2 et
nc = Cells(2, 6)
J'ai donc Colonne$ = F et nc = 6
Sub Ouvre()
Cells(2, 3) = Feuil2.Name
Feuille$ = Cells(2, 3)
Colonne$ = Cells(2, 5)
nc = Cells(2, 6)
Feuil2.Select
Columns(Colonne$).Select
Selection.Copy
Selection.Insert Shift:=xlToRight
Range(Colonne$ & "2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=LOOKUP(RC[1],Base!R1C1:R24C1,Base!R1C2:R24C2)"
Selection.AutoFill Destination:=Range("F2:F1000") ' Comment mettre cela avec la variable Colonne$ ou nc ?
Range("F2:F1000").Select ' Comment mettre cela avec la variable Colonne$ ou nc ?
Columns(Colonne$).EntireColumn.AutoFit
Columns(Colonne$).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range(Colonne$ & "1").Select
Application.CutCopyMode = False
Columns("G:G").Select ' Comment mettre cela avec la variable Colonne$ + 1 à droite soit G ou nc +1?
Selection.EntireColumn.Hidden = True
End Sub
Comment les mettent en place ces variables dans ce code ?
D'avance merci
Dominique