Dear All--
I am thinking about this code a couple days now. I cannot help but wondering what on Earth did it written. I can understand that this code looking for some kind of macro named
Can anyone help me? This code written in Excel 2003 and does not run under 2010. I am not sure It is even useful routine.... Thank you very much!
PS: Oh, yea... this is French stuff!
I am thinking about this code a couple days now. I cannot help but wondering what on Earth did it written. I can understand that this code looking for some kind of macro named
Code:
[LEFT][COLOR=#333333]Worksheet_SelectionChange.[/COLOR][/LEFT]
But Why?
Also the part of the code:
is blurry as wall as
and
Also the part of the code:
Code:
[COLOR=#333333] .ProcCountLines(.ProcOfLine(StartLine, vbext_pk_Proc), vbext_pk_Proc)"[/COLOR]
is blurry as wall as
Code:
[COLOR=#333333] StartLine = .CountOfDeclarationLines + 1" [/COLOR]
and
Code:
[COLOR=#333333] Do Until StartLine >= .CountOfLines
[/COLOR][COLOR=#333333]msg = .ProcOfLine(StartLine, vbext_pk_Proc)"[/COLOR]
Can anyone help me? This code written in Excel 2003 and does not run under 2010. I am not sure It is even useful routine.... Thank you very much!
PS: Oh, yea... this is French stuff!
Code:
[COLOR=#323333][FONT=Courier]Function ChercheSaisieEncadree(Ipurge As Boolean) As Boolean[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]ChercheSaisieEncadree = False[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]Dim nomProc As Variant[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]nomProc = "Worksheet_SelectionChange"[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]'fs, mpfe (d'aprčs Chip Pearson)[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]'nécessite une référence ŕ Microsoft Visual Basic Extensibility[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]Dim VBCodeMod As CodeModule[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]Dim StartLine As Long[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]Dim msg As String, Ret$, done As Boolean[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]Dim ProcName As String[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]' With ActiveWorkbook.VBProject.VBComponents("Feuil2").CodeModule[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]' For I = 1 To ActiveWorkbook.VBProject.VBComponents.Count[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Set VBCodeMod = _[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] ThisWorkbook.VBProject.VBComponents("Feuil2").CodeModule[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] With VBCodeMod[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] StartLine = .CountOfDeclarationLines + 1[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Do Until StartLine >= .CountOfLines[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] msg = .ProcOfLine(StartLine, vbext_pk_Proc)[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] If msg = nomProc Then[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] ' Ret = "La procédure '" & nomProc & "' est dans le module '"[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] ' Ret = Ret & .Parent.Name & "' de ce classeur."[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Ret = "start line " & StartLine & vbLf[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Ret = Ret & "nB lIGNES " & .ProcCountLines(.ProcOfLine(StartLine, _[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] vbext_pk_Proc), vbext_pk_Proc) & vbLf[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Dim i As Long[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] For i = StartLine To StartLine + .ProcCountLines(.ProcOfLine(StartLine, _[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] vbext_pk_Proc), vbext_pk_Proc)[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Ret = Ret & .Lines(i, 1) & vbCr[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Next[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] ' MsgBox Ret[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] done = True[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] If Ipurge Then 'purge eventuelle[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] .DeleteLines StartLine, .ProcCountLines(.ProcOfLine(StartLine, vbext_pk_Proc), vbext_pk_Proc)[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] End If[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Exit Do[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] End If[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] StartLine = StartLine + .ProcCountLines(.ProcOfLine(StartLine, _[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] vbext_pk_Proc), vbext_pk_Proc)[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] Loop[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] End With[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]' Next[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] ' If Not done Then _[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] MsgBox "La procédure '" & nomProc & "' n'existe pas dans ce classeur"[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]
[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] ChercheSaisieEncadree = done[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]
[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier] 'MsgBox done[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]
[/FONT][/COLOR]
[COLOR=#323333][FONT=Courier]End Function[/FONT][/COLOR]