Variable dans recherche v

lool29860 Messages postés 4 Date d'inscription lundi 19 mai 2008 Statut Membre Dernière intervention 12 février 2009 - 19 mai 2008 à 18:07
lool29860 Messages postés 4 Date d'inscription lundi 19 mai 2008 Statut Membre Dernière intervention 12 février 2009 - 20 mai 2008 à 11:04
bonjour

je souhaite intégrer dans un formule recherche V le nom qui sera intégrer dans la boite inbox
je vous joins mon programme; j'ai mis en rouge le fichier que souhaite passer en variable
je n'arrive pas à trouver la bonne syntaxe pour le faire
Nom1 InputBox("quel est le nom du fichier des données à récupérer" & Chr(10) & "(Juin) ")<?xml:namespace prefix o ns = "urn:schemas-microsoft-com:office:office" /??>

    Nom2 = InputBox("quel est le nom du cd a mettre à jour" & Chr(10) & "(n'oubliez pas de mettre un espace entre mois et année)")

    Nom1bis = "G:\ESI\PROD\Planning\export" & Nom1 & ".xls"

    Nom2bis = "G:\ESI\PROD\Planning\CD " & Nom2 & ".xls"

   

    Nom1ter = Nom1 & ".xls"

    Nom2ter = "CD " & Nom2 & ".xls"

 

  

    Workbooks.Open Filename:=Nom1bis

'

    Windows(Nom1ter).Activate

    Columns("B:B").Select

    Selection.Insert Shift:=xlToRight

    Columns("C:C").Select

    Selection.Insert Shift:=xlToRight

    Selection.Insert Shift:=xlToRight

    Columns("D:D").Select

    Selection.Insert Shift:=xlToRight

    Range("B2").Select

    ActiveCell.FormulaR1C1 = "=MID(RC[-1],1,1)"

    Range("C2").Select

    ActiveCell.FormulaR1C1 = "=MID(RC[-2],3,2)"

    Range("D2").Select

    ActiveCell.FormulaR1C1 = "=MID(RC[-3],6,4)"

    Range("E2").Select

    ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-3],RC[-2],RC[-1])"

    Range("B2:E2").Select

    Selection.AutoFill Destination:=Range("B2:E348"), Type:=xlFillDefault

    Range("B2:E348").Select

    ActiveWindow.ScrollRow = 1

    Range("D1").Select

    Windows(Nom2ter).Activate

    Columns("A:A").Select

    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _

        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _

        Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _

        :=Array(1, 2)

    ActiveWindow.SmallScroll ToRight:=21

    Range("AF165").Select

    ActiveWindow.SmallScroll Down:=-150

    Range("AF6").Select

    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-31],[Juin.xls]A!R2C5:R329C14,9,FALSE)"

    Selection.AutoFill Destination:=Range("AF6:AF350"), Type:=xlFillDefault

j'ai essayé en remplaçant juin.xls par Nom1 mais ça ne marche pas

lool

3 réponses

cs_MPi Messages postés 3877 Date d'inscription mardi 19 mars 2002 Statut Membre Dernière intervention 17 août 2018 23
20 mai 2008 à 10:44
Comme ceci peut-être ?
"=VLOOKUP(RC[-31],[" & Nom1 & "]A!R2C5:R329C14,9,FALSE)"



MPi²
Pour ceux qui programment sous Office, n'oubliez pas qu'il existe un forum dédié à ces applications VBA....... ICI
0
lool29860 Messages postés 4 Date d'inscription lundi 19 mai 2008 Statut Membre Dernière intervention 12 février 2009
20 mai 2008 à 11:04
lool
0
lool29860 Messages postés 4 Date d'inscription lundi 19 mai 2008 Statut Membre Dernière intervention 12 février 2009
20 mai 2008 à 11:04
lool
0
Rejoignez-nous