OVH Cloud OVH Cloud

:-))) Une autre traduction

1 réponse
Avatar
papou
Dim Collec As New Collection, Cell As Range, Plage As Range
'Dis-moi nouvelle collègue, celle qui va à la plage
On Error Resume Next
'arrêtes-moi si je me trompe
Set Plage = Application.InputBox("Plage à examiner", Type:=8)
'à la plage si tu me le demandes je veux bien examiner ton type
If IsEmpty(Plage) Then Exit Sub
'Mais si tu dis non je partirai tout de suite
For Each Cell In Plage
'et toi celle qui t'étends sur la plage
If Cell.Value <> "" Then
'si tu ne dis rien
Collec.Add Cell.Value, CStr(Cell.Value)
'j' ajouterai ton string à ma collection
If Err <> 0 Then
'et si je ne suis pas un zéro
Err.Clear
'alors je serai clair
Cell.Interior.ColorIndex = 43
'et te badigeonnerai de vert (des algues)
Else
'et sinon
Cell.Interior.ColorIndex = 6
'je te badigeonnerai de l'or (du soleil)
End If
End If
Next Cell

De: "sonic@view" <sonic@view.com>
Objet: Traduction
Date: mardi 18 novembre 2003 14:34

Bonjour,

Vous pouvez me traduire, ligne par ligne ces 2 programmes ?

1)

Sub premier()


ActiveSheet.UsedRange.EntireRow.Sort Key1:=ActiveSheet.UsedRange.Cells(1)
lin = Columns(1).Find("*", , , , , xlPrevious).Row
encore:
keep = False
For col = 1 To Rows(lin).Find("*", , , , , xlPrevious).Column
If Cells(lin, col) <> Cells(lin - 1, col) Then keep = True
Next col
If keep = False Then Rows(lin).Delete
lin = lin - 1
If lin > 1 Then GoTo encore




End Sub




2)



Sub second()


Dim Collec As New Collection, Cell As Range, Plage As Range

On Error Resume Next

Set Plage = Application.InputBox("Plage à examiner", Type:=8)

If IsEmpty(Plage) Then Exit Sub

For Each Cell In Plage

If Cell.Value <> "" Then
Collec.Add Cell.Value, CStr(Cell.Value)
If Err <> 0 Then
Err.Clear
Cell.Interior.ColorIndex = 43
Else
Cell.Interior.ColorIndex = 6
End If

End If

Next Cell



End Sub

1 réponse

Avatar
DJ9B
excellant !

--
@ tantôt !
email : http://www.cerbermail.com/?05npeGunAn
Site : http://www.dj9b.fr.st



Dans le fameux MPFE papou a écrit il y a peu :

Dim Collec As New Collection, Cell As Range, Plage As Range
'Dis-moi nouvelle collègue, celle qui va à la plage
On Error Resume Next
'arrêtes-moi si je me trompe
Set Plage = Application.InputBox("Plage à examiner", Type:=8)
'à la plage si tu me le demandes je veux bien examiner ton type
If IsEmpty(Plage) Then Exit Sub
'Mais si tu dis non je partirai tout de suite
For Each Cell In Plage
'et toi celle qui t'étends sur la plage
If Cell.Value <> "" Then
'si tu ne dis rien
Collec.Add Cell.Value, CStr(Cell.Value)
'j' ajouterai ton string à ma collection
If Err <> 0 Then
'et si je ne suis pas un zéro
Err.Clear
'alors je serai clair
Cell.Interior.ColorIndex = 43
'et te badigeonnerai de vert (des algues)
Else
'et sinon
Cell.Interior.ColorIndex = 6
'je te badigeonnerai de l'or (du soleil)
End If
End If
Next Cell

De: ""
Objet: Traduction
Date: mardi 18 novembre 2003 14:34

Bonjour,

Vous pouvez me traduire, ligne par ligne ces 2 programmes ?

1)

Sub premier()


ActiveSheet.UsedRange.EntireRow.Sort
Key1:¬tiveSheet.UsedRange.Cells(1) lin = Columns(1).Find("*", , , ,
, xlPrevious).Row encore:
keep = False
For col = 1 To Rows(lin).Find("*", , , , , xlPrevious).Column
If Cells(lin, col) <> Cells(lin - 1, col) Then keep = True
Next col
If keep = False Then Rows(lin).Delete
lin = lin - 1
If lin > 1 Then GoTo encore




End Sub




2)



Sub second()


Dim Collec As New Collection, Cell As Range, Plage As Range

On Error Resume Next

Set Plage = Application.InputBox("Plage à examiner", Type:=8)

If IsEmpty(Plage) Then Exit Sub

For Each Cell In Plage

If Cell.Value <> "" Then
Collec.Add Cell.Value, CStr(Cell.Value)
If Err <> 0 Then
Err.Clear
Cell.Interior.ColorIndex = 43
Else
Cell.Interior.ColorIndex = 6
End If

End If

Next Cell



End Sub