Hi All,
Ma vlook up est un peu lourd sur mon fichier de 35 000 ligne comment optimiser ou changer ma fonction pour que ca aille plus vite ?
pour l instant j ai une macro qui :
* copie toute la colonne code client ( code 3 3 2 du type AXE_BEL_IT ) dans une nouvelle colonne
* qui "replace" _ par " " pour obtenir AXE BEL IT
* je crée une autre colonne ou je tire un vlookup sur les 65 000 lignes d excel ( ma base de mapping et du type AXE BEL IT qui correspond en francais a AXELIUM BELLIA ITALIA nom en francais )
* pour finir ca crée une troisieme colonnes ou je copie colle les resultats de la vlookup
durée de la manip en automatique ...... 5 min et quelque, montre en main !!! lollll regardez ma belle macro !!! les bons en VBA vont sourire :
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 20/07/2006 by AZF
'
' Keyboard Shortcut: Ctrl+a
'
Range("B2").Select
Sheets("INPUT Ctrl V Base SWAP").Select
Cells.Select
Selection.Copy
Sheets("OUTPUT RESULT").Select
Range("A1").Select
ActiveSheet.Paste
Columns("T:T").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Columns("S:S").Select
Selection.Copy
Columns("T:T").Select
ActiveSheet.Paste
Selection.Replace What:="_", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("U:U").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Range("U1").Select
ActiveCell.FormulaR1C1 = "NAME 1"
Range("U2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'INPUT Ctrl V Base BCC'!RC[-19]:R[49998]C[-18],2,FALSE)"
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'INPUT Ctrl V Base BCC'!R2C[-19]:R50000C[-18],2,FALSE)"
Range("U2").Select
Selection.Copy
Range("U3").Select
ActiveSheet.Paste
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Columns("V:V").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Columns("U:U").Select
Selection.Copy
Range("V1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("V1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "NAME 2"
Range("V2").Select
Columns("S:S").ColumnWidth = 14.86
Columns("T:T").ColumnWidth = 17.86
Columns("T:T").ColumnWidth = 15.57
Columns("U:U").ColumnWidth = 40.71
Columns("U:U").ColumnWidth = 57.71
Columns("V:V").ColumnWidth = 30.57
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
Columns("V:V").ColumnWidth = 63.14
End Sub
il y a surement une tonne de chose inutiles dans cette macro pour l instant elle me sert mais c est bien trop long !!!
Si vous avez des idées !!!
Merci d avance !!!
Ma vlook up est un peu lourd sur mon fichier de 35 000 ligne comment optimiser ou changer ma fonction pour que ca aille plus vite ?
pour l instant j ai une macro qui :
* copie toute la colonne code client ( code 3 3 2 du type AXE_BEL_IT ) dans une nouvelle colonne
* qui "replace" _ par " " pour obtenir AXE BEL IT
* je crée une autre colonne ou je tire un vlookup sur les 65 000 lignes d excel ( ma base de mapping et du type AXE BEL IT qui correspond en francais a AXELIUM BELLIA ITALIA nom en francais )
* pour finir ca crée une troisieme colonnes ou je copie colle les resultats de la vlookup
durée de la manip en automatique ...... 5 min et quelque, montre en main !!! lollll regardez ma belle macro !!! les bons en VBA vont sourire :
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 20/07/2006 by AZF
'
' Keyboard Shortcut: Ctrl+a
'
Range("B2").Select
Sheets("INPUT Ctrl V Base SWAP").Select
Cells.Select
Selection.Copy
Sheets("OUTPUT RESULT").Select
Range("A1").Select
ActiveSheet.Paste
Columns("T:T").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Columns("S:S").Select
Selection.Copy
Columns("T:T").Select
ActiveSheet.Paste
Selection.Replace What:="_", Replacement:=" ", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Columns("U:U").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Range("U1").Select
ActiveCell.FormulaR1C1 = "NAME 1"
Range("U2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'INPUT Ctrl V Base BCC'!RC[-19]:R[49998]C[-18],2,FALSE)"
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'INPUT Ctrl V Base BCC'!R2C[-19]:R50000C[-18],2,FALSE)"
Range("U2").Select
Selection.Copy
Range("U3").Select
ActiveSheet.Paste
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Columns("V:V").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlToRight
Columns("U:U").Select
Selection.Copy
Range("V1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("V1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "NAME 2"
Range("V2").Select
Columns("S:S").ColumnWidth = 14.86
Columns("T:T").ColumnWidth = 17.86
Columns("T:T").ColumnWidth = 15.57
Columns("U:U").ColumnWidth = 40.71
Columns("U:U").ColumnWidth = 57.71
Columns("V:V").ColumnWidth = 30.57
ActiveWindow.ScrollColumn = 12
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 17
ActiveWindow.ScrollColumn = 16
ActiveWindow.ScrollColumn = 15
ActiveWindow.ScrollColumn = 14
ActiveWindow.ScrollColumn = 13
ActiveWindow.ScrollColumn = 12
Columns("V:V").ColumnWidth = 63.14
End Sub
il y a surement une tonne de chose inutiles dans cette macro pour l instant elle me sert mais c est bien trop long !!!
Si vous avez des idées !!!
Merci d avance !!!