Sub lg()
Dim textega1 As String, lignesTab, tmpStr As String, i As Integer, curCell As Range
Application.ScreenUpdating = False
If Range("AV3") <> "Sib" Then Exit Sub
On Error GoTo fini
longueur.Show
If ActiveSheet.Range("ga1000") = "" Then GoTo non
textega1 = ActiveSheet.Range("ga1000").Value
Set curCell = ActiveSheet.Range("ga1001")
lignesTab = Split(textega1, Chr(10))
For i = LBound(lignesTab) To UBound(lignesTab)
If InStr(lignesTab(i), "Longueur actuelle: ") Then
tmpStr = Right(lignesTab(i), Len(lignesTab(i)) - Len("Longueur actuelle: "))
If InStr(tmpStr, ",") Then tmpStr = Mid(tmpStr, 1, InStr(tmpStr, ",") - 1)
curCell.Value = tmpStr
Set curCell = curCell.Offset(1, 0)
End If
Next i
'Unload longueur = DEJA FAIT
ActiveSheet.Range("ga1000") = ""
'lg.Value = ""
'ActiveSheet.Range("ga10000").Select
' ActiveSheet.Range(Selection, Selection.End(xlUp)).Select
' derniere = ActiveCell.Row
lgs = 19
For ligne = 1001 To 20000
If ActiveSheet.Range("ga" & ligne) = "" Then Exit For
Range("aj" & lgs) = ActiveSheet.Range("ga" & ligne)
For rep = 1 To 120
If Range("h" & lgs + rep) <> "" And Range("h" & lgs + rep).Rows.Hidden = False Then
lgs = lgs + rep
Exit For
End If
Next rep
Next ligne
non:
GoTo saut
fini:
MsgBox "ERREUR"
saut:
[B][COLOR=blue]Set curCell = Nothing
[/COLOR][/B] ActiveSheet.Range("ga1000:ga20000") = ""
ActiveSheet.Range("ga10000:ga12000") = ""
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
ActiveSheet.Range("i4").Select
End Sub