Sub Index()
Range("A1").Select
Workbooks.Add
ChDir "C:\Acad\Index_x"
ActiveWorkbook.SaveAs Filename:="C:\Acad\Index_x\index_06.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Workbooks.Add
ActiveWorkbook.SaveAs Filename:="C:\Acad\Index_x\index_02.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Workbooks.Add
ActiveWorkbook.SaveAs Filename:="C:\Acad\Index_x\index_er.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.Run "Biblio.xls!ORF11"
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Key2:=ActiveCell. _
Offset(0, 2).Range("A1"), Order2:=xlAscending, Key3:=ActiveCell.Offset(0, 1). _
Range("A1"), Order3:=xlAscending, Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
Windows("Biblio.xls").Activate
Range("A1").Select
Application.Run "Biblio.xls!ORF12"
Range("A1").Select
Windows("index_02.xls").Activate
ActiveCell.Offset(0, -7).Columns("A:A").EntireColumn.Select
Selection.Find(What:="Généralités", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False).Activate
ActiveCell.Select
Selection.EntireRow.Delete
Range("A1").Select
Cells.Replace What:="[", Replacement:="- ", LookAt:=xlPart, SearchOrder _
:=xlByRows, MatchCase:=False
Cells.Replace What:="]", Replacement:="", LookAt:=xlPart, SearchOrder:= _
xlByRows, MatchCase:=False
Range("A1").Select
ActiveCell.Select
Selection.EntireColumn.Insert
Selection.EntireColumn.Insert
ActiveCell.Offset(0, 1).Range("A1").Select
Workbooks.Open Filename:="C:\Acad\Indic\Listweb.xls"
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("index_02.xls").Activate
ActiveSheet.Paste
Selection.End(xlDown).Select
ActiveCell.Offset(0, -1).Range("A1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "$"
Range("A1").Select
ActiveCell.FormulaR1C1 = "si(LC(1)=LC(2);""vrai"";""faux"")"
ActiveCell.FormulaR1C1 = "=IF(RC[1]=RC[2],""vrai"",""faux"")"
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveCell.Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "TRUE"
ChDir "C:\Acad\Indic"
ActiveWorkbook.SaveAs Filename:="C:\Acad\Indic\indexweb.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
Sub ORF11()
Dim Vlig, Vlig2, Vlig3 As String
Dim Vcol As Integer
Windows("INDEX_er.xls").Activate
Windows("INDEX_06.xls").Activate
Range("A1").Select
Vlig2 = CStr(ActiveCell().Row)
Windows("BIBLIO.XLS").Activate
Vlig = CStr(ActiveCell().Row)
Vcol = IIf(ActiveCell().Column < 7, 7, ActiveCell().Column)
Range("B" & Vlig).Select
While Len(ActiveCell()) > 0
Vbib0 = Trim(ActiveCell())
Range("C" & Vlig).Select
Vx = InStr(1, ActiveCell(), ".")
Vbib1 = Left(ActiveCell(), Vx - 1)
Range("D" & Vlig).Select
Vbib6 = Trim(ActiveCell())
Vbib6 = IIf(Right(Vbib6, 1) = ".", Left(Vbib6, Len(Vbib6) - 1), Vbib6)
ActiveCell.Offset(0, Vcol - 4).Range("A1").Select
While Len(ActiveCell()) > 0
Vx = InStr(1, ActiveCell(), ":")
Vy = IIf(InStr(1, ActiveCell(), "~*") = 0, Len(ActiveCell()), InStr(1, ActiveCell(), "~*") - 1)
Vy1 = IIf(InStr(1, ActiveCell(), "~*") = 0, Len(ActiveCell()), InStr(1, ActiveCell(), "~*"))
Vvg3 = IIf(InStr(1, ActiveCell(), "~*") = 0, "", Right(ActiveCell(), Len(ActiveCell()) - Vy1))
Vg3 = Trim(Vg3)
Vz0 = 0
Vz0 = InStr(1, Vg3, "~*")
If Vz0 > 0 Then
Vg4 = Right(Vg3, Len(Vg3) - Vz0)
Vg4 = Trim(Vg4)
Vw = InStr(1, Vg4, ".")
Vg3 = Left(Vg3, Vz0 - 2)
Vg3 = Trim(Vg3)
Else
Vg4 = ""
Vw = -1
End If
Vv = InStr(1, Vg3, ".")
Vg = IIf(Vv > 0, Vg3, IIf(Vw > 0, Vg4, ""))
Vg2 = IIf(Vv = 0, IIf(Vw = -1, Vg3, IIf(Vw = 0, Vg3 + " " + Vg4, Vg4)), IIf(Vw = -1, "", IIf(Vw = 0, Vg4, "")))
Vx = IIf(InStr(1, ActiveCell(), ":") = 0, IIf(InStr(1, ActiveCell(), ".") = 0, InStr(1, ActiveCell(), " "), InStr(1, ActiveCell(), ".")), InStr(1, ActiveCell(), ":"))
Vesp = IIf(Vx > 1, Left(ActiveCell(), Vx - 1), "")
Vesp = Trim(Vesp)
Vesp = IIf(Len(Vg) > 0, Vesp + " " + Vg, Vesp)
Vesp = IIf(Len(Vg2) > 0, Vesp + " " + Vg2, Vesp)
Vbib2 = Left(Right(ActiveCell(), Len(ActiveCell()) - Vx), Vy - Vx)
If Not IsNull(Vbib2) Then
Vbib2 = Trim(Vbib2)
End If
Range("E" & Vlig).Select
Vbib3 = Trim(ActiveCell())
Range("F" & Vlig).Select
Vbib4 = Trim(ActiveCell())
Vbib5 = "{" + Vbib3 + Vbib4 + "}"
Vbib = "[" + Vbib0 + " " + Vbib1 + ". " + Vbib6 + ". " + Vbib5 + " : " + Vbib2 + "]"
Van = "'" + Vbib1
If IsNull(Vesp) Or IsNull(Vbib) Or IsNull(Van) Or IsNull(Vlig2) Then
Windows("INDEX_ER.XLS").Activate
Range("A" & Vlig3).Select
ActiveCell() = Vlig
Range("B" & Vlig3).Select
ActiveCell() = Vcol
Vlig3 = CStr(Val(Vlig3) + 1)
Else
Windows("INDEX_06.XLS").Activate
Range("A" & Vlig2).Select
ActiveCell() = Vesp
Range("B" & Vlig2).Select
ActiveCell() = Vbib
Range("C" & Vlig2).Select
ActiveCell() = Van
Vlig2 = CStr(Val(Vlig2) + 1)
End If
Windows("BIBLIO.XLS").Activate
Vcol = CStr(Val(Vcol) + 1)
ActiveCell.Offset(0, Vcol - 6).Range("A1").Select
Wend
Vlig = CStr(Val(Vlig) + 1)
Vcol = 7
Range("B" & Vlig).Select
Wend
Windows("INDEX_06.XLS").Activate
End Sub
Sub ORF12()
Windows("INDEX_06.xls").Activate
Cells.Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Key2:=Range("C1") _
, Order2:=xlAscending, Key3:=Range("B1"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
Windows("INDEX_02.xls").Activate
Cells.Select
Cells.Delete
Vliga = "1"
Vlig2a = "1"
Windows("INDEX_06.xls").Activate
Range("A" & Vliga).Select
While Len(ActiveCell()) > 0
Vesp = Trim(ActiveCell())
Vcol2 = 0
While Vesp = Trim(ActiveCell())
Range("B" & Vliga).Select
Vbib = Trim(ActiveCell())
Windows("INDEX_02.xls").Activate
If Vcol2 = 0 Then
Range("A" & Vlig2a).Select
ActiveCell() = Vesp
End If
Range("B" & Vlig2a).Select
ActiveCell.Offset(0, Vcol2).Range("A1").Select
ActiveCell() = Vbib
Vcol2 = Vcol2 + 1
Windows("INDEX_06.xls").Activate
Vliga = CStr(Val(Vliga) + 1)
Range("A" & Vliga).Select
Wend
Vlig2a = CStr(Val(Vlig2a) + 1)
Range("A" & Vliga).Select
Wend
End Sub
Range("E" & Vlig).Select
Vbib3 = Trim(ActiveCell())
Vbib3 = Trim(Range("E" & Vlig))
Bonjour Misange,
Je suis désolée mais je n'ai pas écrit ce code.
Si il faut écrire 3 lignes d'exemple pour avoir la réponse, c'est OK, je le ferai.
Mais je crois comprendre en relisant les autres réponse initiales que c'était peut-être des plaisanteries.
Si oui, il vaut mieux dire que ma demande dépasse ce forum et je ferai mes 90 minutes par semaine.
Merci quand même, Steph